Skip to content

Commit

Permalink
The reject function is being used to propagate an error, but this cou…
Browse files Browse the repository at this point in the history
…ld lead to issues if the reject function is called multiple times.
  • Loading branch information
noble-wave committed Dec 24, 2024
1 parent 48cf606 commit 2e03357
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions projects/ngx-indexed-db/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function validateStoreName(db: IDBDatabase, storeName: string): boolean {
export function validateBeforeTransaction(db: IDBDatabase, storeName: string, reject: (message: string) => void): void {
if (!db) {
reject('You need to use the openDatabase function to create a database before you query it!');
return; // Stop further execution
}
if (!validateStoreName(db, storeName)) {
reject(`objectStore does not exists: ${storeName}`);
Expand Down

0 comments on commit 2e03357

Please sign in to comment.