Browse Source

fix(gui): if default clipboard copy failed due to permission use the fallback

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4100/head
Pranav C 2 years ago
parent
commit
97efdb11a7
  1. 10
      packages/nc-gui/composables/useCopy.ts

10
packages/nc-gui/composables/useCopy.ts

@ -15,9 +15,13 @@ export const useCopy = () => {
const { copy: _copy, isSupported } = useClipboard() const { copy: _copy, isSupported } = useClipboard()
const copy = async (text: string) => { const copy = async (text: string) => {
if (isSupported.value) { try {
await _copy(text) if (isSupported.value) {
} else { await _copy(text)
} else {
copyFallback(text)
}
} catch (e) {
copyFallback(text) copyFallback(text)
} }
} }

Loading…
Cancel
Save