@@ -305,15 +305,15 @@ export const mainSlice = createSlice({
305
305
const { snapshots, sliderIndex} = tabs [ currentTab ] || { } ;
306
306
307
307
// eslint-disable-next-line max-len
308
- // resets name to 0 to send to background.js the current name in the jump action
309
- port . postMessage ( {
310
- action : 'jumpToSnap' ,
311
- index : 0 ,
312
- name : 0 ,
313
- payload : snapshots [ 0 ] ,
314
- tabId : currentTab ,
315
- } ) ;
316
- tabs [ currentTab ] . sliderIndex = 0 ;
308
+ // resets name to 0 to send to background.js the current name in the jump action
309
+ port . postMessage ( {
310
+ action : 'jumpToSnap' ,
311
+ index : 0 ,
312
+ name : 0 ,
313
+ payload : snapshots [ 0 ] ,
314
+ tabId : currentTab ,
315
+ } ) ;
316
+ tabs [ currentTab ] . sliderIndex = 0 ;
317
317
} ,
318
318
319
319
@@ -323,51 +323,51 @@ export const mainSlice = createSlice({
323
323
const { port, tabs, currentTab } = state ;
324
324
const { mode} = tabs [ currentTab ] || { } ;
325
325
mode [ action . payload ] = ! mode [ action . payload ] ;
326
- const newMode = mode [ action . payload ] ;
327
- let actionText ;
328
- switch ( action . payload ) {
329
- case 'paused' :
330
- actionText = 'setPause' ;
331
- default :
332
- }
333
- port . postMessage ( {
334
- action : actionText ,
335
- payload : newMode ,
336
- tabId : currentTab ,
337
- } ) ;
326
+ const newMode = mode [ action . payload ] ;
327
+ let actionText ;
328
+ switch ( action . payload ) {
329
+ case 'paused' :
330
+ actionText = 'setPause' ;
331
+ default :
332
+ }
333
+ port . postMessage ( {
334
+ action : actionText ,
335
+ payload : newMode ,
336
+ tabId : currentTab ,
337
+ } ) ;
338
338
} ,
339
339
importSnapshots : ( state , action ) => {
340
340
console . log ( 'importSnapshots' )
341
341
const { port, tabs, currentTab } = state ;
342
- // Log the value of tabs[currentTab].snapshots before the update
343
- port . postMessage ( {
344
- action : 'import' ,
345
- payload : action . payload ,
346
- tabId : currentTab ,
347
- } ) ;
348
-
349
- const savedSnapshot = action . payload ;
350
-
351
- tabs [ currentTab ] . sliderIndex = savedSnapshot . sliderIndex ;
352
- tabs [ currentTab ] . viewIndex = savedSnapshot . viewIndex ;
353
- tabs [ currentTab ] . playing = false ;
354
-
355
- // resets hierarchy to page last state recorded
356
- tabs [ currentTab ] . hierarchy . stateSnapshot = savedSnapshot . hierarchy . stateSnapshot ;
357
-
358
- // resets hierarchy
359
- tabs [ currentTab ] . hierarchy . children = savedSnapshot . hierarchy . children ;
360
-
361
- // resets snapshots to page last state recorded
362
- tabs [ currentTab ] . snapshots = savedSnapshot . snapshots ;
363
-
364
- // resets currLocation to page last state recorded
365
- tabs [ currentTab ] . currLocation = tabs [ currentTab ] . hierarchy ;
366
- tabs [ currentTab ] . index = savedSnapshot . index ;
367
- tabs [ currentTab ] . currParent = savedSnapshot . currParent ;
368
- tabs [ currentTab ] . currBranch = savedSnapshot . Branch ;
369
- tabs [ currentTab ] . seriesSavedStatus = false ;
370
- }
342
+ // Log the value of tabs[currentTab].snapshots before the update
343
+ port . postMessage ( {
344
+ action : 'import' ,
345
+ payload : action . payload ,
346
+ tabId : currentTab ,
347
+ } ) ;
348
+
349
+ const savedSnapshot = action . payload ;
350
+
351
+ tabs [ currentTab ] . sliderIndex = savedSnapshot . sliderIndex ;
352
+ tabs [ currentTab ] . viewIndex = savedSnapshot . viewIndex ;
353
+ tabs [ currentTab ] . playing = false ;
354
+
355
+ // resets hierarchy to page last state recorded
356
+ tabs [ currentTab ] . hierarchy . stateSnapshot = savedSnapshot . hierarchy . stateSnapshot ;
357
+
358
+ // resets hierarchy
359
+ tabs [ currentTab ] . hierarchy . children = savedSnapshot . hierarchy . children ;
360
+
361
+ // resets snapshots to page last state recorded
362
+ tabs [ currentTab ] . snapshots = savedSnapshot . snapshots ;
363
+
364
+ // resets currLocation to page last state recorded
365
+ tabs [ currentTab ] . currLocation = tabs [ currentTab ] . hierarchy ;
366
+ tabs [ currentTab ] . index = savedSnapshot . index ;
367
+ tabs [ currentTab ] . currParent = savedSnapshot . currParent ;
368
+ tabs [ currentTab ] . currBranch = savedSnapshot . Branch ;
369
+ tabs [ currentTab ] . seriesSavedStatus = false ;
370
+ } ,
371
371
} ,
372
372
} )
373
373
0 commit comments