Skip to content

Commit e323273

Browse files
committed
dateBUg
Signed-off-by: Vedansh Saini <[email protected]>
1 parent d0d45be commit e323273

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/scripts/popup.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ document.addEventListener('DOMContentLoaded', function () {
129129
'githubToken',
130130
'projectName',
131131
'settingsToggle',
132+
132133
];
133134

134135
const radios = document.querySelectorAll('input[name="timeframe"]');
@@ -269,10 +270,29 @@ document.addEventListener('DOMContentLoaded', function () {
269270
chrome.storage.local.get([
270271
'selectedTimeframe',
271272
'lastWeekContribution',
272-
'yesterdayContribution'
273+
'yesterdayContribution',
274+
'startingDate',
275+
'endingDate',
273276
], (items) => {
274277
console.log('Restoring state:', items);
275278

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+
276296
if (!items.selectedTimeframe) {
277297
items.selectedTimeframe = 'yesterdayContribution';
278298
items.lastWeekContribution = false;

0 commit comments

Comments
 (0)