Skip to content

Commit

Permalink
raidemulator: move encounter loading outside of Dexie zone (#5757)
Browse files Browse the repository at this point in the history
Fixes #5756
  • Loading branch information
quisquous authored Aug 8, 2023
1 parent 80fee75 commit 946930a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/raidboss/emulator/data/Persistor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export default class Persistor extends Dexie {
}

public async loadEncounter(id: number): Promise<Encounter | undefined> {
return new Promise<Encounter | undefined>((res) => {
void this.transaction('readwrite', [this.encounters, this.encounterSummaries], async () => {
res(await this.encounters.get(id));
});
let enc: Encounter | undefined;
await this.transaction('readwrite', [this.encounters, this.encounterSummaries], async () => {
enc = await this.encounters.get(id);
});
return enc;
}

public async persistEncounter(baseEncounter: Encounter): Promise<unknown> {
Expand Down

0 comments on commit 946930a

Please sign in to comment.