From 6c35d88fc9e5f5a57f62a44a235e2b1de29e5fa7 Mon Sep 17 00:00:00 2001 From: Zining Date: Fri, 22 Nov 2024 12:26:07 -0500 Subject: [PATCH 1/2] fix feature-845-add-query-improvement --- .../src/features/search/query/querySlice.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mcweb/frontend/src/features/search/query/querySlice.js b/mcweb/frontend/src/features/search/query/querySlice.js index 83f818311..2e657119a 100644 --- a/mcweb/frontend/src/features/search/query/querySlice.js +++ b/mcweb/frontend/src/features/search/query/querySlice.js @@ -145,23 +145,24 @@ const querySlice = createSlice({ }, addQuery: (state, { payload }) => { const freezeState = state; + const lastQuery = freezeState[freezeState.length - 1] || {}; freezeState.push( { queryString: '', queryList: [[], [], []], negatedQueryList: [[], [], []], - platform: payload.platform, - startDate, - endDate: dayjs(latestAllowedEndDate(DEFAULT_PROVIDER)).format('MM/DD/YYYY'), - collections: [], - previewCollections: [], - sources: [], - previewSources: [], + platform: payload.platform || lastQuery.platform || DEFAULT_PROVIDER, + startDate: lastQuery.startDate || startDate, + endDate: lastQuery.endDate || dayjs(latestAllowedEndDate(DEFAULT_PROVIDER)).format('MM/DD/YYYY'), + collections: [...(lastQuery.collections || [])], + previewCollections: [...(lastQuery.previewCollections || [])], + sources: [...(lastQuery.sources || [])], + previewSources: [...(lastQuery.previewSources || [])], lastSearchTime: dayjs().unix(), isFromDateValid: true, isToDateValid: true, anyAll: 'any', - advanced: payload.advanced, + advanced: payload.advanced || false, name: 'Query', edited: false, }, From d814792e2af101dd4e818905106700c9ba1d1f5d Mon Sep 17 00:00:00 2001 From: Zining Date: Fri, 22 Nov 2024 12:28:22 -0500 Subject: [PATCH 2/2] Fix: Update query behavior to preserve dates and media when adding a new query --- dump.rdb | Bin 0 -> 8748 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 dump.rdb diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 0000000000000000000000000000000000000000..700b6cefb4f027221ac8f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