From aaf435a27e2b680c3883723b2955faadbbe313ca Mon Sep 17 00:00:00 2001 From: dszymanski Date: Thu, 1 Feb 2024 17:24:24 +0100 Subject: [PATCH] [Issue #2487] Use messagesStore instead raw JS alert --- client/components/watch/ShareOptions.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/components/watch/ShareOptions.vue b/client/components/watch/ShareOptions.vue index 1ecc2486b..452362699 100644 --- a/client/components/watch/ShareOptions.vue +++ b/client/components/watch/ShareOptions.vue @@ -35,6 +35,7 @@ import QrPopUp from '@/components/popup/QrPopUp.vue'; import ShareOptionEntry from '@/components/list/ShareOptionEntry.vue'; import { useVideoPlayerStore } from '@/store/videoPlayer'; +import { useMessagesStore } from '@/store/messages'; export default defineComponent({ name: 'ShareOptions', @@ -49,6 +50,7 @@ export default defineComponent({ } }, setup(props) { + const messagesStore = useMessagesStore(); const qrPopUpOpen = ref(false); const videoPlayerStore = useVideoPlayerStore(); @@ -65,7 +67,12 @@ export default defineComponent({ }; const writeToClipboard = (text: string) => { if (!navigator.clipboard) { - alert('Unable to copy (running ViewTube on non-https website).'); + messagesStore.createMessage({ + title: 'Unable to copy', + message: 'Running ViewTube on non-https website.', + type: 'error', + dismissDelay: 3000 + }); return; } navigator.clipboard.writeText(text);