From db469711cfe1f609cd1386ded1e86f36c7b0be81 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 28 Feb 2023 15:00:10 +0000 Subject: [PATCH] Optimise resetting data to smoothly transition when changing datasource --- packages/frontend-core/src/components/sheet/stores/rows.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/frontend-core/src/components/sheet/stores/rows.js b/packages/frontend-core/src/components/sheet/stores/rows.js index c49da287a7..2fa58f4c76 100644 --- a/packages/frontend-core/src/components/sheet/stores/rows.js +++ b/packages/frontend-core/src/components/sheet/stores/rows.js @@ -25,8 +25,6 @@ export const createRowsStore = context => { } // Wipe state and fully hydrate next time our fetch returns data loaded = false - rowCacheMap = {} - rows.set([]) // Create fetch and load initial data return fetchData({ @@ -62,6 +60,8 @@ export const createRowsStore = context => { if (!loaded) { // Hydrate initial data loaded = true + rowCacheMap = {} + rows.set([]) schema.set($$fetch.schema) primaryDisplay.set($$fetch.definition?.primaryDisplay) }