Merge branch 'bug-fix-missing-service-worker' into 'master'
Don't show webpush section if navigator.serviceWorker is undefined Closes #740 See merge request framasoft/mobilizon!967
This commit is contained in:
commit
2f0eac4654
|
@ -686,7 +686,7 @@ export default class Notifications extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
async checkCanShowWebPush(): Promise<boolean> {
|
async checkCanShowWebPush(): Promise<boolean> {
|
||||||
if (!window.isSecureContext && !("serviceWorker" in navigator))
|
if (!window.isSecureContext || !("serviceWorker" in navigator))
|
||||||
return Promise.resolve(false);
|
return Promise.resolve(false);
|
||||||
const registration = await navigator.serviceWorker.getRegistration();
|
const registration = await navigator.serviceWorker.getRegistration();
|
||||||
return registration !== undefined;
|
return registration !== undefined;
|
||||||
|
|
Loading…
Reference in a new issue