mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bump beta.18
This commit is contained in:
15 files changed
+34
-18
No files matched your search
@@ -31,13 +31,20 @@ try {
|
||||
__webpack_public_path__ = UiContext.cdn_prefix;
|
||||
} catch (e) { }
|
||||
if ('serviceWorker' in navigator) {
|
||||
const sendConfig = () => fetch('/service-worker-config', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(UiContext.SWConfig),
|
||||
});
|
||||
navigator.serviceWorker.register('/service-worker.js').then((registration) => {
|
||||
console.log('SW registered: ', registration);
|
||||
fetch('/service-worker-config', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(UiContext.SWConfig),
|
||||
});
|
||||
const sw = registration.active || registration.waiting || registration.installing;
|
||||
if (sw.state === 'activated') sendConfig();
|
||||
else {
|
||||
sw.addEventListener('statechange', (e) => {
|
||||
if (e.target.state === 'activated') sendConfig();
|
||||
});
|
||||
}
|
||||
}).catch((registrationError) => {
|
||||
console.log('SW registration failed: ', registrationError);
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.58.0-beta.18",
|
||||
"version": "4.58.0-beta.19",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "index.ts",
|
||||
|
||||
Reference in new issue
Block a user