Skip to content

Commit 2c741e2

Browse files
committed
fixup! Add an api call for web config if no default url
1 parent 6ee87e4 commit 2c741e2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/service-worker/ServiceWorker.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -771,17 +771,17 @@ export class ServiceWorker {
771771
const defaultNotificationUrlFromConfig = config.origin;
772772
if (defaultNotificationUrlFromConfig) {
773773
launchUrl = defaultNotificationUrlFromConfig;
774+
775+
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+
});
780+
}
774781
}
775782
} catch (e) {
776783
Log.error("Failed to get app config to determine default notification url", e);
777784
}
778-
779-
if (!!launchUrl && !dbDefaultNotificationUrl) {
780-
// intentionally not awaiting this promise to not block notification click handling
781-
Database.setAppState({ defaultNotificationUrl: launchUrl }).catch(e => {
782-
Log.error("Failed to save default notification url to db", e);
783-
});
784-
}
785785
}
786786

787787
// If the user clicked an action button, use the URL provided by the action button

0 commit comments

Comments
 (0)