@1sat/wallet-toolbox 0.0.68 → 0.0.69
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 +16 -0
- package/package.json +1 -1
package/dist/wallet/factory.js
CHANGED
|
@@ -120,6 +120,22 @@ export async function createWebWallet(config) {
|
|
|
120
120
|
conflictingActives: storage.getConflictingStores().length,
|
|
121
121
|
isActiveEnabled: storage.isActiveEnabled,
|
|
122
122
|
});
|
|
123
|
+
// Handle conflicting actives - must resolve before wallet can function
|
|
124
|
+
if (storage.getConflictingStores().length > 0) {
|
|
125
|
+
const localKey = storage.getActiveStore();
|
|
126
|
+
console.log("[createWebWallet] Resolving conflicting actives...");
|
|
127
|
+
try {
|
|
128
|
+
await storage.setActive(localKey, (msg) => {
|
|
129
|
+
console.log("[createWebWallet] Conflict resolution:", msg);
|
|
130
|
+
return msg;
|
|
131
|
+
});
|
|
132
|
+
console.log("[createWebWallet] Conflict resolution complete");
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
console.log("[createWebWallet] Conflict resolution failed, falling back to local-only:", err instanceof Error ? err.message : err);
|
|
136
|
+
remoteClient = undefined;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
123
139
|
// Helper to sync to remote backup using public updateBackups API
|
|
124
140
|
const syncToBackup = async (context) => {
|
|
125
141
|
if (storage.getBackupStores().length > 0) {
|