Skip to content

Commit 6571574

Browse files
committed
Add await to database save call
1 parent e91fb42 commit 6571574

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/service-worker/ServiceWorker.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,14 +773,11 @@ export class ServiceWorker {
773773
launchUrl = defaultNotificationUrlFromConfig;
774774

775775
if (!dbDefaultNotificationUrl) {
776-
// intentionally not awaiting this promise to not block notification click handling
777-
Database.setAppState({ defaultNotificationUrl: defaultNotificationUrlFromConfig }).catch(e => {
778-
Log.error("Failed to save default notification url to db", e);
779-
});
776+
await Database.setAppState({ defaultNotificationUrl: defaultNotificationUrlFromConfig });
780777
}
781778
}
782779
} catch (e) {
783-
Log.error("Failed to get app config to determine default notification url", e);
780+
Log.error("Failed to update notification in the database", e);
784781
}
785782
}
786783

0 commit comments

Comments
 (0)