mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 08:33:39 +08:00
FIX: Prevent undefined on isSafari capabilities test (#21914)
Added a null coalesce operator on the field `isSafari` on the capabilities service to prevent an error in case `pushNotifications` is `undefined`
This commit is contained in:
parent
0615f5cc95
commit
58c3bbc080
|
@ -29,7 +29,7 @@ export default class Capabilities extends Service {
|
||||||
this.isChrome = !!window.chrome && !this.isOpera;
|
this.isChrome = !!window.chrome && !this.isOpera;
|
||||||
this.isSafari =
|
this.isSafari =
|
||||||
/Constructor/.test(window.HTMLElement) ||
|
/Constructor/.test(window.HTMLElement) ||
|
||||||
window.safari?.pushNotification.toString() ===
|
window.safari?.pushNotification?.toString() ===
|
||||||
"[object SafariRemoteNotification]";
|
"[object SafariRemoteNotification]";
|
||||||
|
|
||||||
this.hasContactPicker =
|
this.hasContactPicker =
|
||||||
|
|
Loading…
Reference in New Issue
Block a user