FEATURE: Use new Badging API
Now that the spec is finished use the unprefixed API, which was also moved from window to navigator. Still uses feature detection so it fail gracefully when not available in the user agent.
This commit is contained in:
parent
3ddebc61a9
commit
5a70f50032
|
@ -4,7 +4,7 @@ export default {
|
|||
after: "message-bus",
|
||||
|
||||
initialize(container) {
|
||||
if (!window.ExperimentalBadge) return; // must have the Badging API
|
||||
if (!navigator.setAppBadge) return; // must have the Badging API
|
||||
|
||||
const user = container.lookup("current-user:main");
|
||||
if (!user) return; // must be logged in
|
||||
|
@ -18,6 +18,6 @@ export default {
|
|||
},
|
||||
|
||||
_updateBadge() {
|
||||
window.ExperimentalBadge.set(this.notifications);
|
||||
navigator.setAppBadge(this.notifications);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue