diff --git a/dump.rdb b/dump.rdb new file mode 100644 index 000000000..700b6cefb Binary files /dev/null and b/dump.rdb differ 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, },