@1sat/wallet-toolbox 0.0.15 → 0.0.16
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/wallet/factory.js +9 -7
- package/package.json +1 -1
package/dist/wallet/factory.js
CHANGED
|
@@ -110,19 +110,21 @@ export async function createWebWallet(config) {
|
|
|
110
110
|
storageAny._backups = [];
|
|
111
111
|
}
|
|
112
112
|
// If there are conflicting actives (including reclassified backups), resolve by merging into local
|
|
113
|
-
//
|
|
113
|
+
// This is now blocking since setActive no longer holds IDB transactions during network calls
|
|
114
114
|
if (storageAny._conflictingActives && storageAny._conflictingActives.length > 0) {
|
|
115
115
|
const localKey = storageAny._active?.settings?.storageIdentityKey;
|
|
116
116
|
if (localKey && storageAny.setActive) {
|
|
117
117
|
console.log("[createWebWallet] Syncing with remote storage...");
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
try {
|
|
119
|
+
await storageAny.setActive(localKey, (msg) => {
|
|
120
|
+
console.log("[createWebWallet] Sync:", msg);
|
|
121
|
+
return msg;
|
|
122
|
+
});
|
|
122
123
|
console.log("[createWebWallet] Remote sync complete");
|
|
123
|
-
}
|
|
124
|
+
}
|
|
125
|
+
catch (err) {
|
|
124
126
|
console.log("[createWebWallet] Remote sync failed:", err instanceof Error ? err.message : err);
|
|
125
|
-
}
|
|
127
|
+
}
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
// Update wallet's storage reference
|