File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { createMigrate, PersistedState } from 'redux-persist';
5
5
import { PersistConfig } from 'storage/persistReducer' ;
6
6
import { ModuleCode } from 'types/modules' ;
7
7
import { ModuleLessonConfig , SemTimetableConfig , TimetableConfig } from 'types/timetables' ;
8
- import { ColorMapping , TimetablesState } from 'types/reducers' ;
8
+ import { ColorMapping , CustomisedModulesMap , TimetablesState } from 'types/reducers' ;
9
9
10
10
import config from 'config' ;
11
11
import {
@@ -35,8 +35,11 @@ export function migrateV1toV2(
35
35
) : TimetablesState & PersistedState {
36
36
const newLessons : TimetableConfig = { } ;
37
37
const oldLessons = oldState . lessons ;
38
+ const newCustomisedModules : CustomisedModulesMap = { } ;
38
39
39
40
Object . entries ( oldLessons ) . forEach ( ( [ semester , modules ] ) => {
41
+ newCustomisedModules [ semester ] = [ ] ;
42
+
40
43
Object . entries ( modules ) . forEach ( ( [ moduleCode , lessons ] ) => {
41
44
const newSemester : { [ moduleCode : string ] : { [ lessonType : string ] : string [ ] } } = {
42
45
[ moduleCode ] : { } ,
@@ -56,6 +59,7 @@ export function migrateV1toV2(
56
59
return {
57
60
...oldState ,
58
61
lessons : newLessons ,
62
+ customisedModules : newCustomisedModules ,
59
63
} ;
60
64
}
61
65
You can’t perform that action at this time.
0 commit comments