Browse Source

fix: ResizeObserver bug and missing error handler

pull/9112/head
Pranav C 5 months ago
parent
commit
3ca9222b78
  1. 21
      packages/nc-gui/app.vue
  2. 6
      packages/nc-gui/composables/useViewColumns.ts

21
packages/nc-gui/app.vue

@ -96,6 +96,27 @@ onMounted(() => {
refreshCommandPalette() 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)
}
}
</script> </script>
<template> <template>

6
packages/nc-gui/composables/useViewColumns.ts

@ -434,7 +434,7 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState(
scope: defineViewScope({ view: view.value }), scope: defineViewScope({ view: view.value }),
}) })
} }
try {
// sync with server if allowed // sync with server if allowed
if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) { if (!isPublic.value && isUIAllowed('viewFieldEdit') && gridViewCols.value[id]?.id) {
await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, { await $api.dbView.gridColumnUpdate(gridViewCols.value[id].id as string, {
@ -451,6 +451,10 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState(
// fallback to reload // fallback to reload
await loadViewColumns() await loadViewColumns()
} }
}catch (e) {
}
} }
watch( watch(

Loading…
Cancel
Save