Skip to content

Commit cccc07e

Browse files
committed
Fix auth.bulkLoad
1 parent b0092af commit cccc07e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modules/auth.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,8 @@ export async function bulkLoad(fields = [], usr = null, pwd = null, isAdmin = fa
793793
continue;
794794
}
795795
deletedData = fetchedBulkLoad.syncDeleted?.[table] || [];
796-
existingData = (((await storage.idbGet((isAdmin || isTA) ? "adminCache" : "cache")) || storage.get((isAdmin || isTA) ? "adminCache" : "cache") || {})?.[table] || []).filter(item => {
796+
const cacheObj = (await storage.idbGet((isAdmin || isTA) ? "adminCache" : "cache")) || storage.get((isAdmin || isTA) ? "adminCache" : "cache") || {};
797+
existingData = (Array.isArray(cacheObj[table]) ? cacheObj[table] : []).filter(item => {
797798
return !deletedData.includes(String(item.id || item.seatCode || item.period || item.key || item.username || 0));
798799
});
799800
mergedData = [...existingData];

0 commit comments

Comments
 (0)