Update preferences store to handle dates in telemetryRequested item
This commit is contained in:
parent
a725dfdc4d
commit
65856adb33
@ -25,7 +25,15 @@ function createPreferencesStore() {
|
|||||||
let stored: Preferences;
|
let stored: Preferences;
|
||||||
try {
|
try {
|
||||||
const json = localStorage.getItem(STORAGE_KEY);
|
const json = localStorage.getItem(STORAGE_KEY);
|
||||||
stored = json ? JSON.parse(json) : DEFAULT_PREFERENCES;
|
if (json) {
|
||||||
|
stored = JSON.parse(json);
|
||||||
|
// Convert telemetryRequested back to Date if it exists
|
||||||
|
stored.telemetryRequested = stored.telemetryRequested
|
||||||
|
? new Date(stored.telemetryRequested)
|
||||||
|
: null;
|
||||||
|
} else {
|
||||||
|
stored = DEFAULT_PREFERENCES;
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
stored = DEFAULT_PREFERENCES;
|
stored = DEFAULT_PREFERENCES;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user