summaryrefslogtreecommitdiff
path: root/client/store.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-04-28 17:12:15 +0200
committerJules Laplace <julescarbon@gmail.com>2019-04-28 17:12:15 +0200
commitd349e62cf53eda4b1a6b3cdc75ae9302dc2d4d5d (patch)
tree84a978c41c2c585b68a3eee3048785b5c3f60d6c /client/store.js
parentece8612b7077d1a71de21badb43d94b8af3ab10a (diff)
browse by clicking results
Diffstat (limited to 'client/store.js')
-rw-r--r--client/store.js24
1 files changed, 22 insertions, 2 deletions
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: