From d73d7113aedd31a4674ca4560080f34b98d67f5f Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 3 Jun 2024 10:07:42 +0200 Subject: [PATCH] Refresh on error --- .../components/grid/controls/ColumnsSettingButton.svelte | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte index aa27871f92..228cf69e34 100644 --- a/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte +++ b/packages/frontend-core/src/components/grid/controls/ColumnsSettingButton.svelte @@ -19,13 +19,17 @@ const visible = permission !== PERMISSION_OPTIONS.HIDDEN const readonly = permission === PERMISSION_OPTIONS.READONLY - datasource.actions.addSchemaMutation(column.name, { visible, readonly }) + await datasource.actions.addSchemaMutation(column.name, { + visible, + readonly, + }) try { await datasource.actions.saveSchemaMutations() } catch (e) { notifications.error(e.message) } finally { - datasource.actions.resetSchemaMutations() + await datasource.actions.resetSchemaMutations() + await datasource.actions.refreshDefinition() } dispatch(visible ? "show-column" : "hide-column") }