diff --git a/source/utilities/settings.ts b/source/utilities/settings.ts index 4d356d9..044b185 100644 --- a/source/utilities/settings.ts +++ b/source/utilities/settings.ts @@ -23,9 +23,17 @@ const defaultSettings: Settings = { */ export async function getSettings(): Promise { const syncSettings: any = await browser.storage.sync.get(defaultSettings); + + const queue: QItem[] = syncSettings.queue; + + // Initialize all the non-JSON values, as they are stringified when saved. + for (const item of queue) { + item.added = new Date(item.added); + } + const settings: Settings = { latestVersion: syncSettings.latestVersion, - queue: syncSettings.queue + queue }; return settings;