Skip to content

Commit

Permalink
fix(bug): getBooleanAsync and getNumberAsync in native default
Browse files Browse the repository at this point in the history
I had previously forgotten to await the value here, which resulted in incorrect "undefined" results... ;-;
  • Loading branch information
Pkmmte committed Sep 25, 2022
1 parent 528e33e commit 65df31d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/async-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default class AsyncStorageBackend implements StashyBackend {
};

public async getBooleanAsync(key: string): Promise<boolean> {
const value = this.getString(key);
const value = await this.getStringAsync(key);
return value ? value === 'true' : null;
};

Expand All @@ -51,7 +51,7 @@ export default class AsyncStorageBackend implements StashyBackend {
};

public async getNumberAsync(key: string): Promise<number> {
const value = this.getString(key);
const value = await this.getStringAsync(key);
return value ? parseFloat(value) : null;
};

Expand Down

0 comments on commit 65df31d

Please sign in to comment.