@lls/offline 24.31.0-6f233767 → 24.31.0-72d368eb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -539,11 +539,6 @@ var initChannel = async (__, { ports }) => {
|
|
|
539
539
|
offlineWorker.onmessage = combineHandlers(syncHandler, onHandler);
|
|
540
540
|
offlineWorker.onclose = () => {
|
|
541
541
|
console.error("socket to ow has been closed!");
|
|
542
|
-
swSelf.clients.matchAll({ includeUncontrolled: true }).then((clientList) => {
|
|
543
|
-
for (const client of clientList) {
|
|
544
|
-
client.postMessage({ methodName: "reloadChannels" });
|
|
545
|
-
}
|
|
546
|
-
});
|
|
547
542
|
};
|
|
548
543
|
await offlineWorkerSync.ensureAppReady();
|
|
549
544
|
};
|
|
@@ -514,7 +514,6 @@ var initChannel = (__, { ports }) => {
|
|
|
514
514
|
fetchWorker.onmessage = combineHandlers(syncHandler, onHandler);
|
|
515
515
|
fetchWorker.onclose = () => {
|
|
516
516
|
console.error("socket to sw has been closed!");
|
|
517
|
-
self.postMessage({ methodName: "reloadChannels" });
|
|
518
517
|
};
|
|
519
518
|
};
|
|
520
519
|
var loadBooks = async ({ primaryOnly = false } = {}) => {
|
package/lib/index.js
CHANGED
|
@@ -146,19 +146,15 @@ var installWorker = async ({
|
|
|
146
146
|
} = {}) => {
|
|
147
147
|
const fetchWorker = await fetchWorkerPromise;
|
|
148
148
|
const configureOptions = { storage, zipBaseUrl, checkUpdates, confEnv };
|
|
149
|
-
const reloadChannels = async () => {
|
|
150
|
-
location.reload();
|
|
151
|
-
};
|
|
152
149
|
if (nativeReadFile) {
|
|
153
|
-
const wwHandler = makeSyncHandler({
|
|
150
|
+
const wwHandler = makeSyncHandler({ nativeReadFile, nativeWriteFile, nativeListZips });
|
|
154
151
|
offlineWorker.onmessage = combineHandlers(handler, wwHandler);
|
|
155
152
|
if (storage !== "native") {
|
|
156
153
|
console.warn("nativeReadFile given, ignoring storage", storage);
|
|
157
154
|
}
|
|
158
155
|
offlineWorkerSync.configure({ ...configureOptions, storage: "native" });
|
|
159
156
|
} else {
|
|
160
|
-
|
|
161
|
-
offlineWorker.onmessage = combineHandlers(handler, wwHandler);
|
|
157
|
+
offlineWorker.onmessage = handler.handle;
|
|
162
158
|
await offlineWorkerSync.configure(configureOptions);
|
|
163
159
|
}
|
|
164
160
|
const channel = new MessageChannel();
|
|
@@ -167,8 +163,7 @@ var installWorker = async ({
|
|
|
167
163
|
"initChannel",
|
|
168
164
|
"configure"
|
|
169
165
|
]);
|
|
170
|
-
|
|
171
|
-
navigator.serviceWorker.onmessage = combineHandlers(fetchWorkerHandler, swHandler);
|
|
166
|
+
navigator.serviceWorker.onmessage = combineHandlers(fetchWorkerHandler);
|
|
172
167
|
await fetchWorkerSync.initChannel({ ports: [channel.port2] });
|
|
173
168
|
await fetchWorkerSync.configure({ storage, confEnv });
|
|
174
169
|
offlineWorkerSync.on("opfsProgress", () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lls/offline",
|
|
3
|
-
"version": "24.31.0-
|
|
3
|
+
"version": "24.31.0-72d368eb",
|
|
4
4
|
"description": "offline",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib/index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vite": "7.1.11",
|
|
55
55
|
"vite-tsconfig-paths": "5.1.4",
|
|
56
56
|
"zod": "3.25.50",
|
|
57
|
-
"@lls/vitescripts": "24.31.0-
|
|
57
|
+
"@lls/vitescripts": "24.31.0-72d368eb"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"redux-persist": "6.0.0"
|