Merge pull request 'pwa config' (#242) from pwa into develop

Reviewed-on: https://akkoma.dev/AkkomaGang/pleroma-fe/pulls/242
This commit is contained in:
floatingghost 2022-12-02 12:01:43 +00:00
commit 105ecd3836
4 changed files with 49 additions and 70 deletions

View file

@ -51,6 +51,17 @@ const persistedStateOptions = {
};
(async () => {
if ('serviceWorker' in navigator) {
// declaring scope manually
navigator.serviceWorker.register('/sw-pleroma.js', {scope: '/'}).then((registration) => {
console.log('Service worker registration succeeded:', registration);
}, /*catch*/ (error) => {
console.error(`Service worker registration failed: ${error}`);
});
} else {
console.error('Service workers are not supported.');
}
let storageError = false
const plugins = [pushNotifications]
try {