File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- import { useRef } from 'react' ;
21import defaults from '../constants/defaults' ;
32import migrateThemes from './migrations/colourTheme' ;
43import migratePrimaryTimetables from './migrations/primaryTimetables' ;
@@ -9,7 +8,7 @@ const STORAGE_KEY = 'data';
98// Something is not playing nice and causing local storage to corrupt across signing in/out
109// We are in the process of migrating data to the backend, so this fix should catch people
1110// for now and prevent them from seeing a blank page.
12- const hasRunArrayCheck = useRef ( false ) ;
11+ let hasRunArrayCheck = false ;
1312
1413const storage = {
1514 get : ( key : string ) : any => {
@@ -70,7 +69,7 @@ const storage = {
7069 }
7170
7271 // Un-break an existing issue with migrated data
73- if ( ! hasRunArrayCheck . current ) {
72+ if ( ! hasRunArrayCheck ) {
7473 Object . entries ( migrated . timetables ) . forEach ( ( [ term , timetables ] ) => {
7574 if (
7675 ! Array . isArray ( timetables ) ||
@@ -80,7 +79,8 @@ const storage = {
8079 }
8180 } ) ;
8281
83- hasRunArrayCheck . current = true ;
82+ storage . save ( migrated ) ;
83+ hasRunArrayCheck = true ;
8484 }
8585
8686 // only do this if version does not exist
You can’t perform that action at this time.
0 commit comments