Skip to content

Commit ae73742

Browse files
committed
minor changes to testing
1 parent c476893 commit ae73742

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

src/app/RTKslices.tsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,29 @@ export const mainSlice = createSlice({
170170

171171
changeView: (state, action) => {
172172
const {tabs, currentTab} = state;
173-
console.log('this is state:', current(state))
174-
console.log('this is tabs:', tabs)
175-
console.log('this is currentabs:', currentTab)
176-
console.log('this is tabs[currentab]', tabs[currentTab])
173+
// console.log('this is state:', current(state))
174+
// console.log('this is tabs:', current(tabs))
175+
// console.log('this is currentabs:', currentTab)
176+
// console.log('this is tabs[currentab]', current(tabs[currentTab]))
177177
const {viewIndex} = tabs[currentTab] || {};
178178
console.log('hi this is viewIndex:', viewIndex);
179179
console.log('this is action payload', action.payload)
180-
tabs[currentTab].viewIndex = viewIndex === action.payload ? -1 : action.payload;
180+
// tabs[currentTab].viewIndex = viewIndex === action.payload ? -1 : action.payload;
181+
if (viewIndex === action.payload) tabs[currentTab].viewIndex = -1;
182+
else tabs[currentTab].viewIndex = action.payload;
183+
tabs[currentTab].currLocation = tabs[currentTab].hierarchy;
184+
185+
// case types.CHANGE_VIEW: {
186+
// // unselect view if same index was selected
187+
// // console.log('action:', action)
188+
// // console.log('state: ', state)
189+
// if (viewIndex === action.payload) tabs[currentTab].viewIndex = -1;
190+
// else tabs[currentTab].viewIndex = action.payload;
191+
// // update currLocation
192+
// // tabs[currentTab].currLocation = tabs[currentTab].hierarchy;
193+
// break;
194+
// }
195+
181196
},
182197

183198
changeSlider: (state, action) => {

src/app/reducers/mainReducer.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@
151151
// break;
152152
// }
153153

154-
// case types.CHANGE_VIEW: {
155-
// // unselect view if same index was selected
156-
// // console.log('action:', action)
157-
// // console.log('state: ', state)
158-
// if (viewIndex === action.payload) tabs[currentTab].viewIndex = -1;
159-
// else tabs[currentTab].viewIndex = action.payload;
160-
// // update currLocation
161-
// // tabs[currentTab].currLocation = tabs[currentTab].hierarchy;
162-
// break;
163-
// }
154+
// case types.CHANGE_VIEW: {
155+
// // unselect view if same index was selected
156+
// // console.log('action:', action)
157+
// // console.log('state: ', state)
158+
// if (viewIndex === action.payload) tabs[currentTab].viewIndex = -1;
159+
// else tabs[currentTab].viewIndex = action.payload;
160+
// // update currLocation
161+
// // tabs[currentTab].currLocation = tabs[currentTab].hierarchy;
162+
// break;
163+
// }
164164

165165
// case types.CHANGE_SLIDER: {
166166
// // eslint-disable-next-line max-len

0 commit comments

Comments
 (0)