@mushi-mushi/core 1.22.1 → 1.22.4
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.
- package/dist/index.cjs +5 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -47,7 +47,10 @@ function getSubtle() {
|
|
|
47
47
|
try {
|
|
48
48
|
const g = globalThis;
|
|
49
49
|
const crypto2 = g["crypto"];
|
|
50
|
-
|
|
50
|
+
const subtle = crypto2?.subtle;
|
|
51
|
+
if (subtle && typeof subtle.digest === "function" && typeof subtle.importKey === "function" && typeof subtle.sign === "function") {
|
|
52
|
+
return subtle;
|
|
53
|
+
}
|
|
51
54
|
} catch {
|
|
52
55
|
}
|
|
53
56
|
return null;
|
|
@@ -1237,6 +1240,7 @@ function createOfflineQueue(config = {}) {
|
|
|
1237
1240
|
}
|
|
1238
1241
|
function startAutoSync(client) {
|
|
1239
1242
|
if (!enabled || !syncOnReconnect || typeof window === "undefined") return;
|
|
1243
|
+
if (syncCleanup) stopAutoSync();
|
|
1240
1244
|
const tryFlush = () => {
|
|
1241
1245
|
if (navigator.onLine) {
|
|
1242
1246
|
flush(client).catch((err) => {
|