From 8e93169a5c8af71d60af355ad6f1c3d43e3677f1 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Wed, 18 May 2022 09:10:05 +0800 Subject: [PATCH] fix: drag api group tree error when save (#32) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @buqiyuan nice~ --- src/platform/browser/IndexedDB/lib/index.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platform/browser/IndexedDB/lib/index.ts b/src/platform/browser/IndexedDB/lib/index.ts index 48cfce26d..1ae7197c6 100644 --- a/src/platform/browser/IndexedDB/lib/index.ts +++ b/src/platform/browser/IndexedDB/lib/index.ts @@ -134,7 +134,7 @@ class Storage extends Dexie implements StorageInterface { } }); table - .bulkGet(uuids) + .bulkGet(uuids.map(Number)) .then((existItems) => { if (existItems) { let newItems: Array = []; @@ -146,7 +146,12 @@ class Storage extends Dexie implements StorageInterface { }); // @ts-ignore table - .bulkPut(newItems) + .bulkPut( + newItems.map((n: any) => ({ + ...n, + groupID: ~~n.groupID.replace('group-', ''), + })) + ) .then((result) => { obs.next({ number: result, items: newItems }); obs.complete();