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