Skip to content

Commit

Permalink
fix QR code not working
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Oct 20, 2024
1 parent a293683 commit 079418a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions resources/js/components/modals/ShareAlbum.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<Dialog v-model:visible="visible" modal pt:root:class="border-none">
<template #container="{ closeCallback }">
<div class="flex flex-wrap p-9 gap-5 justify-center align-top text-muted-color" v-if="!qrCodeOpen">
<div class="flex flex-wrap p-9 gap-5 justify-center align-top text-muted-color" v-show="!qrCodeOpen">
<MiniIcon class="w-10 h-10 ionicons cursor-pointer" icon="twitter" v-on:click="openTwitter" />
<MiniIcon class="w-10 h-10 ionicons cursor-pointer" icon="facebook" v-on:click="openFacebook" />
<MiniIcon class="w-10 h-10 cursor-pointer" icon="envelope-closed" v-on:click="openMailto" />
Expand All @@ -10,7 +10,7 @@
</a>
<MiniIcon class="w-10 h-10" icon="grid-two-up" v-on:click="openQrCode" />
</div>
<div class="flex flex-wrap p-9 gap-5 justify-center align-top text-muted-color" v-if="qrCodeOpen">
<div class="flex flex-wrap p-9 gap-5 justify-center align-top text-muted-color" v-show="qrCodeOpen">
<canvas id="canvas"></canvas>
</div>
<Button
Expand All @@ -27,7 +27,7 @@
</Dialog>
</template>
<script setup lang="ts">
import { ref, watch } from "vue";
import { ref } from "vue";
import Button from "primevue/button";
import Dialog from "primevue/dialog";
import { useToast } from "primevue/usetoast";
Expand All @@ -36,15 +36,14 @@ import { trans } from "laravel-vue-i18n";
import MiniIcon from "@/components/icons/MiniIcon.vue";
const props = defineProps<{
url: string;
title: string;
}>();
const toast = useToast();
const qrCodeOpen = ref(false);
const visible = defineModel<boolean>("visible", { default: false });
const url = ref(props.url);
const url = ref(window.location.href);
const title = ref(props.title);
function copyToClipboard() {
Expand Down Expand Up @@ -79,12 +78,4 @@ function openFacebook() {
function openMailto() {
window.open(`mailto:?subject=${encodeURIComponent(title.value)}&body=${encodeURIComponent(url.value)}`);
}
watch(
() => [props.url, props.title],
([newUrl, newTitle], [_oldUrl, _oldTitle]) => {
url.value = newUrl;
title.value = newTitle;
},
);
</script>
2 changes: 1 addition & 1 deletion resources/js/views/gallery-panels/Album.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
/>
</div>
<SensitiveWarning v-if="showNsfwWarning" @click="consent" />
<ShareAlbum v-model:visible="isShareAlbumVisible" :title="album.title" :url="route.path" />
<ShareAlbum v-model:visible="isShareAlbumVisible" :title="album.title" :key="'share_modal_' + album.id" />
<!-- Dialogs -->
<PhotoTagDialog
v-model:visible="isTagVisible"
Expand Down

0 comments on commit 079418a

Please sign in to comment.