@leofcoin/chain 1.7.114 → 1.7.115
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/exports/browser/chain.js +5 -2
- package/exports/chain.js +5 -2
- package/package.json +1 -1
package/exports/browser/chain.js
CHANGED
|
@@ -5370,8 +5370,11 @@ class ConnectionMonitor {
|
|
|
5370
5370
|
window.addEventListener('online', this.#onOnline);
|
|
5371
5371
|
this.#onVisibilityChange = () => {
|
|
5372
5372
|
if (document.visibilityState === 'visible') {
|
|
5373
|
-
console.log('💡 Visibility regained
|
|
5374
|
-
|
|
5373
|
+
console.log('💡 Visibility regained');
|
|
5374
|
+
if (this.connectedPeers.length === 0) {
|
|
5375
|
+
console.log('💡 Visibility regained — attempting restore');
|
|
5376
|
+
void this.#restoreNetwork();
|
|
5377
|
+
}
|
|
5375
5378
|
}
|
|
5376
5379
|
};
|
|
5377
5380
|
document.addEventListener('visibilitychange', this.#onVisibilityChange);
|
package/exports/chain.js
CHANGED
|
@@ -1497,8 +1497,11 @@ class ConnectionMonitor {
|
|
|
1497
1497
|
window.addEventListener('online', this.#onOnline);
|
|
1498
1498
|
this.#onVisibilityChange = () => {
|
|
1499
1499
|
if (document.visibilityState === 'visible') {
|
|
1500
|
-
console.log('💡 Visibility regained
|
|
1501
|
-
|
|
1500
|
+
console.log('💡 Visibility regained');
|
|
1501
|
+
if (this.connectedPeers.length === 0) {
|
|
1502
|
+
console.log('💡 Visibility regained — attempting restore');
|
|
1503
|
+
void this.#restoreNetwork();
|
|
1504
|
+
}
|
|
1502
1505
|
}
|
|
1503
1506
|
};
|
|
1504
1507
|
document.addEventListener('visibilitychange', this.#onVisibilityChange);
|