fix migration
This commit is contained in:
parent
3d9a302cde
commit
e9367fa89f
1 changed files with 4 additions and 3 deletions
|
@ -28,12 +28,13 @@ const EMBEDDINGS_TABLE = 'embeddings_v2';
|
|||
const EMBEDDING_SYNC_TIME_TABLE = 'embedding_sync_time';
|
||||
|
||||
export const getAllLocalEmbeddings = async () => {
|
||||
const embeddings: Array<Embedding> =
|
||||
(await localForage.getItem<Embedding[]>(EMBEDDINGS_TABLE)) ?? [];
|
||||
const embeddings: Array<Embedding> = await localForage.getItem<Embedding[]>(
|
||||
EMBEDDINGS_TABLE
|
||||
);
|
||||
if (!embeddings) {
|
||||
await localForage.removeItem(EMBEDDINGS_TABLE_V1);
|
||||
await localForage.removeItem(EMBEDDING_SYNC_TIME_TABLE);
|
||||
await localForage.setItem(EMBEDDINGS_TABLE, []);
|
||||
await localForage.setItem(EMBEDDING_SYNC_TIME_TABLE, 0);
|
||||
return [];
|
||||
}
|
||||
return embeddings;
|
||||
|
|
Loading…
Add table
Reference in a new issue