Browse Source

fix: review changes #7207

pull/7173/head
Ramesh Mane 9 months ago
parent
commit
fd7c100d9e
  1. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  2. 6
      packages/nc-gui/composables/usePaste.ts

2
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

6
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<boolean> => {
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

Loading…
Cancel
Save