diff --git a/pages/get-playlist-id.vue b/pages/get-playlist-id.vue index 4d2d049..3ab4ae2 100644 --- a/pages/get-playlist-id.vue +++ b/pages/get-playlist-id.vue @@ -2,17 +2,18 @@ import ProgressSpinner from 'primevue/progressspinner'; import InputText from 'primevue/inputtext'; import Button from 'primevue/button'; +import Dialog from 'primevue/dialog'; import { useToast } from 'primevue/usetoast'; const toast = useToast(); const getPlaylistId = useGetPlaylistId(); const { copy } = useClipboard(); -const { isSupported, clipboardWirtePermission, canCopyToClipboard } = - useCanCopyToClipboard(); +const { canCopyToClipboard } = useCanCopyToClipboard(); const playlistUrl = ref(''); const idToShow = ref(''); +const canShowFallbackDialog = ref(false); const actionButtonLabel = computed(() => canCopyToClipboard.value ? 'Copy ID' : 'Show ID' @@ -23,11 +24,13 @@ const copyOrShowPlaylistId = async () => { const playlistId = getPlaylistId(playlistUrl.value); - if (!canCopyToClipboard.value) return (idToShow.value = playlistId); + if (!canCopyToClipboard.value) { + idToShow.value = playlistId; + canShowFallbackDialog.value = true; + return; + } await copy(playlistId); - playlistUrl.value = ''; - toast.add({ severity: 'success', summary: 'Success', @@ -40,22 +43,13 @@ const copyOrShowPlaylistId = async () => {