Skip to content

Commit

Permalink
fix sharing (whoops)
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Jul 27, 2024
1 parent d6b74b7 commit e329beb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pages/gallery/gallery-grid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</p>
</gallery-image>
<v-btn
@click.stop="$emit('changeShareURL', texture.textureID)"
@click.stop="$emit('share', texture.textureID)"
class="ma-2 gallery-share"
absolute
plain
Expand Down
9 changes: 5 additions & 4 deletions pages/gallery/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@
:ignoreList="ignoreList"
:discordIDtoName="discordIDtoName"
:sort="currentSort"
@open="changeShareURL"
@open="newShareURL"
@openNewTab="newTabShareURL"
@share="copyShareURL"
/>

<gallery-modal
Expand Down Expand Up @@ -227,7 +228,7 @@ export default {
return "faithful_64x";
}
},
changeShareURL(id, update = true) {
newShareURL(id, update = true) {
if (update && id !== undefined) this.$router.push({ query: { show: id } });
// need location api to get base url to share
Expand All @@ -243,12 +244,12 @@ export default {
this.$router.push({ query: null });
},
copyShareURL(id) {
const url = this.changeShareURL(id, false);
const url = this.newShareURL(id, false);
navigator.clipboard.writeText(url);
this.$root.showSnackBar(this.$root.lang("gallery.share_link_copied_to_clipboard"), "success");
},
newTabShareURL(id) {
const url = this.changeShareURL(id, false);
const url = this.newShareURL(id, false);
window.open(url, "_blank");
},
openModal(id) {
Expand Down

0 comments on commit e329beb

Please sign in to comment.