Added await to token and map loading

This commit is contained in:
Mitchell McCaffrey
2020-06-07 11:40:14 +10:00
parent 25a5d24cf5
commit 235dad9dbf
2 changed files with 2 additions and 2 deletions

View File

@@ -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];