Skip to content

Commit 6fe39ab

Browse files
committed
Clear variable values when typing a sequence or clicking an sequence example
1 parent 57e360f commit 6fe39ab

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

src/reducers/rootReducer.js

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,54 @@ const rootReducer = function (state = initialState, action) {
142142
return Object.assign({}, state, {statusTimeout: action.statusTimeout});
143143

144144
case actions.TEXTAREA_CHANGE:
145-
return Object.assign({}, state, { sequence: action.sequence });
145+
return Object.assign({}, state, {
146+
sequence: action.sequence,
147+
status: "notSubmitted",
148+
entries: [],
149+
facets: [],
150+
hitCount: 0,
151+
start: 0,
152+
size: 20,
153+
ordering: "e_value",
154+
selectedFacets: {},
155+
alignmentsCollapsed: true,
156+
textSearchError: false,
157+
infernal_status: "notSubmitted",
158+
infernal_entries: [],
159+
});
146160

147161
case actions.EXAMPLE_SEQUENCE:
148162
return Object.assign({}, state, {
149163
sequence: action.sequence,
164+
status: "notSubmitted",
165+
entries: [],
166+
facets: [],
167+
hitCount: 0,
168+
start: 0,
169+
size: 20,
170+
ordering: "e_value",
171+
selectedFacets: {},
172+
alignmentsCollapsed: true,
173+
textSearchError: false,
174+
infernal_status: "notSubmitted",
175+
infernal_entries: [],
150176
});
151177

152178
case actions.CLEAR_SEQUENCE:
153179
return Object.assign({}, state, {
154-
sequence: ""
180+
sequence: "",
181+
status: "notSubmitted",
182+
entries: [],
183+
facets: [],
184+
hitCount: 0,
185+
start: 0,
186+
size: 20,
187+
ordering: "e_value",
188+
selectedFacets: {},
189+
alignmentsCollapsed: true,
190+
textSearchError: false,
191+
infernal_status: "notSubmitted",
192+
infernal_entries: [],
155193
});
156194

157195
case actions.FILE_UPLOAD:

0 commit comments

Comments
 (0)