@@ -170,14 +170,29 @@ export const mainSlice = createSlice({
170
170
171
171
changeView : ( state , action ) => {
172
172
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]) )
177
177
const { viewIndex} = tabs [ currentTab ] || { } ;
178
178
console . log ( 'hi this is viewIndex:' , viewIndex ) ;
179
179
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
+
181
196
} ,
182
197
183
198
changeSlider : ( state , action ) => {
0 commit comments