revert SW
This commit is contained in:
parent
de85ba3e44
commit
4bfc4c9434
|
@ -34,14 +34,6 @@ class SettingsController {
|
|||
self::redirect();
|
||||
}
|
||||
|
||||
static public function misc() {
|
||||
if (isset($_POST['misc-sw'])) {
|
||||
$sw = $_POST['misc-sw'];
|
||||
Cookies::set("misc-sw", $sw);
|
||||
}
|
||||
self::redirect();
|
||||
}
|
||||
|
||||
static private function redirect() {
|
||||
$url = Misc::url('/settings');
|
||||
header("Location: {$url}");
|
||||
|
|
|
@ -16,8 +16,4 @@
|
|||
<link rel="stylesheet" href="{path('/styles/vendor/cssgg.min.css')}">
|
||||
<link rel="stylesheet" href="{path('/styles/vendor/bulma.min.css')}">
|
||||
<title>{$title} - ProxiTok</title>
|
||||
{*/ Handles optional Service Worker /*}
|
||||
{if \App\Helpers\Cookies::check('misc-sw', 'yes')}
|
||||
<script src="{path('/scripts/setup_sw.js')}"></script>
|
||||
{/if}
|
||||
</head>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
{if \App\Helpers\Cookies::check('misc-sw', 'yes')}
|
||||
<script src="{path('/scripts/setup_sw.js')}"></script>
|
||||
{/if}
|
|
@ -1,9 +0,0 @@
|
|||
window.addEventListener("load", () => {
|
||||
if (navigator.serviceWorker) {
|
||||
navigator.serviceWorker.register('/sw.js').then(function (reg) {
|
||||
console.log('Service worker registration was successful, scope: ', reg.scope);
|
||||
}).catch(function (error) {
|
||||
console.log('Service worker failed:', error);
|
||||
});
|
||||
}
|
||||
})
|
17
sw.js
17
sw.js
|
@ -1,17 +0,0 @@
|
|||
const PWA_PRELOAD = {
|
||||
pages: ['/', '/about', '/settings'],
|
||||
scripts: ['/scripts/navbar.js', '/scripts/themes/card.js'],
|
||||
styles: ['/styles/vendor/bulma.min.css', '/styles/vendor/cssgg.min.css', '/styles/themes/card.css']
|
||||
}
|
||||
|
||||
self.addEventListener("install", function(e) {
|
||||
e.waitUntil(
|
||||
caches.open("pwa").then(function(cache) {
|
||||
return cache.addAll([
|
||||
...PWA_PRELOAD.pages,
|
||||
...PWA_PRELOAD.scripts,
|
||||
...PWA_PRELOAD.styles
|
||||
]);
|
||||
})
|
||||
);
|
||||
});
|
|
@ -14,9 +14,4 @@
|
|||
<p class="title">Api</p>
|
||||
{include '../components/settings/api.latte'}
|
||||
</div>
|
||||
<hr />
|
||||
<div class="content">
|
||||
<p class="title">Misc</p>
|
||||
{include '../components/settings/misc.latte'}
|
||||
</div>
|
||||
{/block}
|
||||
|
|
Loading…
Reference in a new issue