Clear badge when onmount too

This commit is contained in:
Lim Chee Aun 2023-09-14 22:31:16 +08:00
parent d18db56032
commit 7a30cc4b12

View file

@ -106,6 +106,11 @@ export default memo(function NotificationService() {
}; };
}, []); }, []);
useLayoutEffect(() => {
if (navigator?.clearAppBadge) {
navigator.clearAppBadge();
}
}, []);
usePageVisibility((visible) => { usePageVisibility((visible) => {
if (visible && navigator?.clearAppBadge) { if (visible && navigator?.clearAppBadge) {
console.log('🔰 Clear app badge'); console.log('🔰 Clear app badge');