@chromahq/store 1.0.23 → 1.0.24

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.js CHANGED
@@ -356,9 +356,18 @@ class BridgeStore {
356
356
  if (this.bridge.on) {
357
357
  this.reconnectHandler = () => {
358
358
  if (STORE_ENABLE_LOGS) {
359
- console.log(`BridgeStore[${this.storeName}]: Bridge reconnected, re-initializing...`);
359
+ console.log(
360
+ `BridgeStore[${this.storeName}]: Bridge reconnected, waiting for SW to initialize...`
361
+ );
360
362
  }
361
- this.forceInitialize();
363
+ setTimeout(() => {
364
+ if (STORE_ENABLE_LOGS) {
365
+ console.log(
366
+ `BridgeStore[${this.storeName}]: Re-initializing after SW startup delay...`
367
+ );
368
+ }
369
+ this.forceInitialize();
370
+ }, 500);
362
371
  };
363
372
  this.bridge.on("bridge:connected", this.reconnectHandler);
364
373
  }
package/dist/index.es.js CHANGED
@@ -336,9 +336,18 @@ class BridgeStore {
336
336
  if (this.bridge.on) {
337
337
  this.reconnectHandler = () => {
338
338
  if (STORE_ENABLE_LOGS) {
339
- console.log(`BridgeStore[${this.storeName}]: Bridge reconnected, re-initializing...`);
339
+ console.log(
340
+ `BridgeStore[${this.storeName}]: Bridge reconnected, waiting for SW to initialize...`
341
+ );
340
342
  }
341
- this.forceInitialize();
343
+ setTimeout(() => {
344
+ if (STORE_ENABLE_LOGS) {
345
+ console.log(
346
+ `BridgeStore[${this.storeName}]: Re-initializing after SW startup delay...`
347
+ );
348
+ }
349
+ this.forceInitialize();
350
+ }, 500);
342
351
  };
343
352
  this.bridge.on("bridge:connected", this.reconnectHandler);
344
353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromahq/store",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Centralized, persistent store for Chrome extensions using zustand, accessible from service workers and React, with chrome.storage.local persistence.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",