From 97efdb11a70c32c571081b26aed0003e75c987c1 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 14 Oct 2022 17:46:26 +0530 Subject: [PATCH] fix(gui): if default clipboard copy failed due to permission use the fallback Signed-off-by: Pranav C --- packages/nc-gui/composables/useCopy.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/composables/useCopy.ts b/packages/nc-gui/composables/useCopy.ts index 10307d43af..c67314a22b 100644 --- a/packages/nc-gui/composables/useCopy.ts +++ b/packages/nc-gui/composables/useCopy.ts @@ -15,9 +15,13 @@ export const useCopy = () => { const { copy: _copy, isSupported } = useClipboard() const copy = async (text: string) => { - if (isSupported.value) { - await _copy(text) - } else { + try { + if (isSupported.value) { + await _copy(text) + } else { + copyFallback(text) + } + } catch (e) { copyFallback(text) } }