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:
Sérgio Saquetim 2023-06-02 19:06:13 -03:00 committed by GitHub
parent 0615f5cc95
commit 58c3bbc080
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ export default class Capabilities extends Service {
this.isChrome = !!window.chrome && !this.isOpera;
this.isSafari =
/Constructor/.test(window.HTMLElement) ||
window.safari?.pushNotification.toString() ===
window.safari?.pushNotification?.toString() ===
"[object SafariRemoteNotification]";
this.hasContactPicker =