From 4e2514c25d6ab51a04deb95a834bd9b2bf9d98f6 Mon Sep 17 00:00:00 2001 From: nichenqin Date: Thu, 14 Nov 2024 12:24:46 +0800 Subject: [PATCH] fix: fix invalidate --- .../blocks/grid-view/editable-cell/button-cell.svelte | 2 +- .../blocks/grid-view/editable-cell/reference-cell.svelte | 2 +- .../components/blocks/grid-view/editable-cell/user-cell.svelte | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/button-cell.svelte b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/button-cell.svelte index 8efd59902..1740f3a3c 100644 --- a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/button-cell.svelte +++ b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/button-cell.svelte @@ -27,7 +27,7 @@ mutationFn: trpc.record.trigger.mutate, async onSuccess(data, variables, context) { gridViewStore.exitEditing() - await recordsStore.invalidateRecord($table, recordId) + await recordsStore?.invalidateRecord($table, recordId) }, onError(error: Error) { toast.error(error.message) diff --git a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/reference-cell.svelte b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/reference-cell.svelte index 41793e661..46ace1011 100644 --- a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/reference-cell.svelte +++ b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/reference-cell.svelte @@ -35,7 +35,7 @@ function onSuccess(id?: string) { if (id) { - recordStore.invalidateRecord($table, id, $viewId) + recordStore?.invalidateRecord($table, id, $viewId) } } diff --git a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/user-cell.svelte b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/user-cell.svelte index 5b237f423..42019ba10 100644 --- a/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/user-cell.svelte +++ b/apps/frontend/src/lib/components/blocks/grid-view/editable-cell/user-cell.svelte @@ -36,7 +36,7 @@ async onSuccess(data, variables) { const value = variables.values[field.id.value] if (isUserFieldMacro(value)) { - await store.invalidateRecord($table, recordId) + await store?.invalidateRecord($table, recordId) } }, onError(error: Error) {