chore: updates

This commit is contained in:
zerosoul
2022-05-16 23:14:55 +08:00
parent 4f6aad0406
commit 7c98d18215
4 changed files with 1826 additions and 1883 deletions
+17
View File
@@ -0,0 +1,17 @@
import { useEffect } from "react";
import PWABadge from "pwa-badge";
export default function usePWABadge() {
// Create an Instance
const badge = new PWABadge();
useEffect(() => {
if (badge.isSupported()) {
badge.asyncSetBadge(2).catch((error) => {
console.error(error);
});
}
}, []);
return {
isSupported: badge.isSupported(),
};
}