From bdb571154bfcd9504ffba219bda134d660682744 Mon Sep 17 00:00:00 2001 From: Alfred Rubin Date: Fri, 24 Nov 2023 16:48:59 +0100 Subject: [PATCH] removing change in runCypherQuery and reusing the status of the queryResult correctly to trigger db change --- src/dashboard/DashboardThunks.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dashboard/DashboardThunks.ts b/src/dashboard/DashboardThunks.ts index 31ce57093..81c9b9620 100644 --- a/src/dashboard/DashboardThunks.ts +++ b/src/dashboard/DashboardThunks.ts @@ -465,6 +465,11 @@ export const loadDashboardFromNeo4jByNameThunk = }; export const loadDashboardListFromNeo4jThunk = (driver, database, callback) => (dispatch: any) => { + function setStatus(status) { + if (status == QueryStatus.NO_DATA) { + runCallback([]); + } + } function runCallback(records) { if (!records || !records[0] || !records[0]._fields) { callback([]); @@ -489,9 +494,7 @@ export const loadDashboardListFromNeo4jThunk = (driver, database, callback) => ( 'MATCH (n:_Neodash_Dashboard) RETURN n.uuid as uuid, n.title as title, toString(n.date) as date, n.user as author, n.version as version ORDER BY date DESC', {}, 1000, - (status) => { - status == QueryStatus.NO_DATA ? runCallback([]) : () => {}; - }, + (status) => setStatus(status), (records) => runCallback(records) ); } catch (e) {