Added await to token and map loading
This commit is contained in:
parent
25a5d24cf5
commit
235dad9dbf
@ -57,7 +57,7 @@ export function MapDataProvider({ children }) {
|
||||
async function loadMaps() {
|
||||
let storedMaps = [];
|
||||
// Use a cursor instead of toArray to prevent IPC max size error
|
||||
database.table("maps").each((map) => storedMaps.push(map));
|
||||
await database.table("maps").each((map) => storedMaps.push(map));
|
||||
const sortedMaps = storedMaps.sort((a, b) => b.created - a.created);
|
||||
const defaultMapsWithIds = await getDefaultMaps();
|
||||
const allMaps = [...sortedMaps, ...defaultMapsWithIds];
|
||||
|
@ -32,7 +32,7 @@ export function TokenDataProvider({ children }) {
|
||||
async function loadTokens() {
|
||||
let storedTokens = [];
|
||||
// Use a cursor instead of toArray to prevent IPC max size error
|
||||
database.table("tokens").each((token) => storedTokens.push(token));
|
||||
await database.table("tokens").each((token) => storedTokens.push(token));
|
||||
const sortedTokens = storedTokens.sort((a, b) => b.created - a.created);
|
||||
const defaultTokensWithIds = getDefaultTokes();
|
||||
const allTokens = [...sortedTokens, ...defaultTokensWithIds];
|
||||
|
Loading…
Reference in New Issue
Block a user