From fd7c100d9ef83cb0f6714d33cd9303f3c86c6bf9 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Tue, 12 Dec 2023 17:32:33 +0530 Subject: [PATCH] fix: review changes #7207 --- packages/nc-gui/components/smartsheet/grid/Table.vue | 2 +- packages/nc-gui/composables/usePaste.ts | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/grid/Table.vue b/packages/nc-gui/components/smartsheet/grid/Table.vue index 4c90c5b913..c48f41b669 100644 --- a/packages/nc-gui/components/smartsheet/grid/Table.vue +++ b/packages/nc-gui/components/smartsheet/grid/Table.vue @@ -169,7 +169,7 @@ const predictNextFormulas = async () => { await _predictNextFormulas(meta) } -const { paste } = usePaste(true) +const { paste } = usePaste() // #Refs diff --git a/packages/nc-gui/composables/usePaste.ts b/packages/nc-gui/composables/usePaste.ts index 0d70a447a7..5987835203 100644 --- a/packages/nc-gui/composables/usePaste.ts +++ b/packages/nc-gui/composables/usePaste.ts @@ -1,12 +1,12 @@ import { useI18n, message } from '#imports' -export const usePaste = (showDialogIfFailed = false) => { +export const usePaste = () => { const { t } = useI18n() const paste = async (): Promise => { try { // Check if the Clipboard API is supported - if (!navigator.clipboard) return false + if (!navigator.clipboard) throw new Error() // Read text from the clipboard const clipboardText = await navigator.clipboard.readText() @@ -27,8 +27,6 @@ export const usePaste = (showDialogIfFailed = false) => { document.dispatchEvent(pasteEvent) return true } catch (e) { - if (!showDialogIfFailed) throw new Error(t('msg.error.pasteFromClipboardError')) - message.error(t('msg.error.pasteFromClipboardError')) return false