Set fallback for PWA badge count to 0 (removes badge)
This commit is contained in:
parent
1826da1e0a
commit
5fc481f797
|
@ -11,7 +11,7 @@ export default class extends Controller<HTMLElement> {
|
||||||
|
|
||||||
connect(): void {
|
connect(): void {
|
||||||
if (this.isPwa && this.badgeCapable) {
|
if (this.isPwa && this.badgeCapable) {
|
||||||
const count = Number.parseInt(this.element.innerText);
|
const count = Number.parseInt(this.element.innerText) || 0;
|
||||||
navigator.setAppBadge(count);
|
navigator.setAppBadge(count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue