Fix dates not being serialized properly in Chromium.
This commit is contained in:
parent
62f2188070
commit
bf8712dbf6
|
@ -37,7 +37,8 @@ export function serializeQueue(queue: Queue.Item[]): Record<string, any> {
|
|||
|
||||
for (const item of queue) {
|
||||
const key = `qi${item.id}`;
|
||||
serialized[key] = item;
|
||||
serialized[key] = {...item};
|
||||
serialized[key].added = item.added.toISOString();
|
||||
}
|
||||
|
||||
return serialized;
|
||||
|
|
|
@ -47,9 +47,14 @@ export class Settings {
|
|||
};
|
||||
this.queue.push(item);
|
||||
|
||||
const sync: Record<string, Queue.Item> = {};
|
||||
sync[`qi${id}`] = item;
|
||||
await browser.storage.sync.set(sync);
|
||||
await browser.storage.sync.set({
|
||||
[`qi${id}`]: {
|
||||
added: item.added.toISOString(),
|
||||
id,
|
||||
text,
|
||||
url,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
public newQueueItemId(): number {
|
||||
|
|
|
@ -32,7 +32,7 @@ Generated by [AVA](https://avajs.dev).
|
|||
|
||||
{
|
||||
qi1: {
|
||||
added: Date 2022-03-02 16:00:00 UTC {},
|
||||
added: '2022-03-02T16:00:00.000Z',
|
||||
id: 1,
|
||||
text: 'Sample',
|
||||
url: 'https://example.org',
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue