File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ document.addEventListener('DOMContentLoaded', function () {
129
129
'githubToken' ,
130
130
'projectName' ,
131
131
'settingsToggle' ,
132
+
132
133
] ;
133
134
134
135
const radios = document . querySelectorAll ( 'input[name="timeframe"]' ) ;
@@ -269,10 +270,29 @@ document.addEventListener('DOMContentLoaded', function () {
269
270
chrome . storage . local . get ( [
270
271
'selectedTimeframe' ,
271
272
'lastWeekContribution' ,
272
- 'yesterdayContribution'
273
+ 'yesterdayContribution' ,
274
+ 'startingDate' ,
275
+ 'endingDate' ,
273
276
] , ( items ) => {
274
277
console . log ( 'Restoring state:' , items ) ;
275
278
279
+ if ( items . startingDate && items . endingDate && ! items . lastWeekContribution && ! items . yesterdayContribution ) { //Add commentMore actions
280
+ const startDateInput = document . getElementById ( 'startingDate' ) ;
281
+ const endDateInput = document . getElementById ( 'endingDate' ) ;
282
+
283
+ if ( startDateInput && endDateInput ) {
284
+ startDateInput . value = items . startingDate ;
285
+ endDateInput . value = items . endingDate ;
286
+ startDateInput . readOnly = false ;
287
+ endDateInput . readOnly = false ;
288
+ }
289
+ document . querySelectorAll ( 'input[name="timeframe"]' ) . forEach ( radio => {
290
+ radio . checked = false ;
291
+ radio . dataset . wasChecked = 'false' ;
292
+ } )
293
+ return ;
294
+ }
295
+
276
296
if ( ! items . selectedTimeframe ) {
277
297
items . selectedTimeframe = 'yesterdayContribution' ;
278
298
items . lastWeekContribution = false ;
You can’t perform that action at this time.
0 commit comments