File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ function handleBodyOnLoad() {
22
22
'userReason' ,
23
23
'lastWeekContribution' ,
24
24
'gsoc' ,
25
+ 'selectedTab' ,
25
26
] ,
26
27
( items ) => {
27
28
if ( items . githubUsername ) {
@@ -65,6 +66,15 @@ function handleBodyOnLoad() {
65
66
} else {
66
67
handleCodeheatClick ( ) ;
67
68
}
69
+ if ( items . selectedTab === 'gsoc' ) {
70
+ handleGsocClick ( ) ;
71
+ }
72
+ else {
73
+ handleCodeheatClick ( ) ;
74
+ }
75
+
76
+ // initialize materialize tabs
77
+ $ ( '.tabs' ) . tabs ( 'select_tab' , items . selectedTab === 'gsoc' ? 'gsocBox' : 'codeheatBox' ) ;
68
78
} ,
69
79
) ;
70
80
}
@@ -147,15 +157,15 @@ function handleCodeheatClick() {
147
157
$ ( '#codeheatTab' ) . addClass ( 'active' ) ;
148
158
$ ( '.tabs' ) . tabs ( ) ;
149
159
$ ( '#noDays' ) . text ( '7 days' ) ;
150
- chrome . storage . local . set ( { gsoc : 0 } ) ;
160
+ chrome . storage . local . set ( { gsoc : 0 , selectedTab : 'codeheat' } ) ;
151
161
handleLastWeekContributionChange ( ) ;
152
162
}
153
163
function handleGsocClick ( ) {
154
164
gsoc = 1 ;
155
165
$ ( '#gsocTab' ) . addClass ( 'active' ) ;
156
166
$ ( '.tabs' ) . tabs ( ) ;
157
167
$ ( '#noDays' ) . text ( '1 day' ) ;
158
- chrome . storage . local . set ( { gsoc : 1 } ) ;
168
+ chrome . storage . local . set ( { gsoc : 1 , selectedTab : 'gsoc' } ) ;
159
169
handleLastWeekContributionChange ( ) ;
160
170
}
161
171
enableToggleElement . addEventListener ( 'change' , handleEnableChange ) ;
You can’t perform that action at this time.
0 commit comments