From d349e62cf53eda4b1a6b3cdc75ae9302dc2d4d5d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 28 Apr 2019 17:12:15 +0200 Subject: browse by clicking results --- client/store.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'client/store.js') diff --git a/client/store.js b/client/store.js index c5f5555..802a47b 100644 --- a/client/store.js +++ b/client/store.js @@ -5,7 +5,18 @@ import thunk from 'redux-thunk' import * as types from './types' const initialState = () => ({ - api: null, + query: { + image: null, + blob: null, + url: "", + threshold: types.SIMILAR_THRESHOLD, + searchType: 'file', + thresholdChanged: false, + saveIfNotFound: false, + }, + api: { + similar: {} + }, }) export default function apiReducer(state = initialState(), action) { @@ -26,7 +37,16 @@ export default function apiReducer(state = initialState(), action) { case types.api.error: return { ...state, - [action.tag]: { error: action.err }, + [action.tag]: { error: action.error }, + } + + case types.api.updateQuery: + return { + ...state, + query: { + ...state.query, + ...action.state, + }, } default: -- cgit v1.2.3-70-g09d2