From 6a34a94bc5de69ebb8ae720976745ee8fbeed001 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 30 Jul 2024 20:35:33 +0000 Subject: [PATCH 1/7] fix: add missing error handling --- packages/nc-gui/composables/useExtensions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/composables/useExtensions.ts b/packages/nc-gui/composables/useExtensions.ts index fb23d0cfb1..7825c259d4 100644 --- a/packages/nc-gui/composables/useExtensions.ts +++ b/packages/nc-gui/composables/useExtensions.ts @@ -345,7 +345,9 @@ export const useExtensions = createSharedComposable(() => { () => base.value?.id, (baseId) => { if (baseId && !baseExtensions.value[baseId]) { - loadExtensionsForBase(baseId) + loadExtensionsForBase(baseId).catch((e) => { + console.error(e) + }) } }, { From 3ca9222b78d217c976baf10fb75bebfc4f3719df Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 30 Jul 2024 20:35:33 +0000 Subject: [PATCH 2/7] fix: ResizeObserver bug and missing error handler --- packages/nc-gui/app.vue | 21 ++++++++++++ packages/nc-gui/composables/useViewColumns.ts | 34 +++++++++++-------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/packages/nc-gui/app.vue b/packages/nc-gui/app.vue index cb78700e70..f51a70eaaf 100644 --- a/packages/nc-gui/app.vue +++ b/packages/nc-gui/app.vue @@ -96,6 +96,27 @@ onMounted(() => { refreshCommandPalette() }) }) + +// ref: https://github.com/vuejs/vue-cli/issues/7431#issuecomment-1793385162 +// Stop error resizeObserver +const debounce = (callback: (...args: any[]) => void, delay: number) => { + let tid: any + return function (...args: any[]) { + const ctx = self + tid && clearTimeout(tid) + tid = setTimeout(() => { + callback.apply(ctx, args) + }, delay) + } +} + +const _ = (window as any).ResizeObserver +;(window as any).ResizeObserver = class ResizeObserver extends _ { + constructor(callback: (...args: any[]) => void) { + callback = debounce(callback, 20) + super(callback) + } +}