@dynamic-labs/store 4.6.3 → 4.7.1

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/CHANGELOG.md CHANGED
@@ -1,4 +1,25 @@
1
1
 
2
+ ### [4.7.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.7.0...v4.7.1) (2025-02-20)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * remove user logout when sdk version change ([#8112](https://github.com/dynamic-labs/dynamic-auth/issues/8112)) ([b1a321f](https://github.com/dynamic-labs/dynamic-auth/commit/b1a321f18231f083aeb365d4dc92e992897a7e1b))
8
+
9
+ ## [4.7.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.3...v4.7.0) (2025-02-20)
10
+
11
+
12
+ ### Features
13
+
14
+ * 7702 support ([14ee3cd](https://github.com/dynamic-labs/dynamic-auth/commit/14ee3cd3513ac8b3e8e866cc2026b042c706b7e6))
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * fallback to empty array when token balances is called with an invalid chain ID ([#8108](https://github.com/dynamic-labs/dynamic-auth/issues/8108)) ([7d14ded](https://github.com/dynamic-labs/dynamic-auth/commit/7d14ded6afa0de604901bbc8bc13620d03dc2e8c))
20
+ * improve global connectivity sign typed data reliability ([#8103](https://github.com/dynamic-labs/dynamic-auth/issues/8103)) ([8b0d2dd](https://github.com/dynamic-labs/dynamic-auth/commit/8b0d2ddbeb62a11732a9d59bc6cd4b72d82b9855))
21
+ * **QNTM-2902:** ensure react updates icons ([#8105](https://github.com/dynamic-labs/dynamic-auth/issues/8105)) ([1182c4c](https://github.com/dynamic-labs/dynamic-auth/commit/1182c4cc103c599e6bbff89af9b1312fb96b6d05))
22
+
2
23
  ### [4.6.3](https://github.com/dynamic-labs/dynamic-auth/compare/v4.6.2...v4.6.3) (2025-02-14)
3
24
 
4
25
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.6.3";
6
+ var version = "4.7.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.6.3";
2
+ var version = "4.7.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/store",
3
- "version": "4.6.3",
3
+ "version": "4.7.1",
4
4
  "description": "Store ",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "./package.json": "./package.json"
19
19
  },
20
20
  "dependencies": {
21
- "@dynamic-labs/assert-package-version": "4.6.3",
22
- "@dynamic-labs/logger": "4.6.3"
21
+ "@dynamic-labs/assert-package-version": "4.7.1",
22
+ "@dynamic-labs/logger": "4.7.1"
23
23
  },
24
24
  "peerDependencies": {}
25
25
  }
@@ -8,7 +8,7 @@ var logger = require('../utils/logger/logger.cjs');
8
8
  /**
9
9
  * Creates a persist middleware that saves the store state to the storage.
10
10
  */
11
- const persist = ({ name, version = '0', storage, store, partialize, onVersionChanged, }) => {
11
+ const persist = ({ name, version = '0', storage, store, partialize, }) => {
12
12
  store.subscribe((state) => {
13
13
  const persistedState = partialize(state);
14
14
  storage.setItem(name, JSON.stringify({ state: persistedState, version }));
@@ -16,13 +16,8 @@ const persist = ({ name, version = '0', storage, store, partialize, onVersionCha
16
16
  const storedState = storage.getItem(name);
17
17
  if (storedState) {
18
18
  try {
19
- const { state: persistedState, version: persistedVersion } = JSON.parse(storedState);
20
- if (persistedVersion === version) {
21
- store.setState(Object.assign(store.getInitialState(), persistedState));
22
- }
23
- else if (onVersionChanged) {
24
- onVersionChanged(persistedVersion);
25
- }
19
+ const { state: persistedState } = JSON.parse(storedState);
20
+ store.setState(Object.assign(store.getInitialState(), persistedState));
26
21
  }
27
22
  catch (error) {
28
23
  logger.logger.error('Failed to load state from storage', error);
@@ -9,10 +9,9 @@ type CreatePersistProps<TStore extends object> = {
9
9
  storage: PersistStorage;
10
10
  partialize: (state: TStore) => Partial<TStore>;
11
11
  store: StoreApi<TStore>;
12
- onVersionChanged?: (persistedVersion: string) => void;
13
12
  };
14
13
  /**
15
14
  * Creates a persist middleware that saves the store state to the storage.
16
15
  */
17
- export declare const persist: <TStore extends object>({ name, version, storage, store, partialize, onVersionChanged, }: CreatePersistProps<TStore>) => StoreApi<TStore>;
16
+ export declare const persist: <TStore extends object>({ name, version, storage, store, partialize, }: CreatePersistProps<TStore>) => StoreApi<TStore>;
18
17
  export {};
@@ -4,7 +4,7 @@ import { logger } from '../utils/logger/logger.js';
4
4
  /**
5
5
  * Creates a persist middleware that saves the store state to the storage.
6
6
  */
7
- const persist = ({ name, version = '0', storage, store, partialize, onVersionChanged, }) => {
7
+ const persist = ({ name, version = '0', storage, store, partialize, }) => {
8
8
  store.subscribe((state) => {
9
9
  const persistedState = partialize(state);
10
10
  storage.setItem(name, JSON.stringify({ state: persistedState, version }));
@@ -12,13 +12,8 @@ const persist = ({ name, version = '0', storage, store, partialize, onVersionCha
12
12
  const storedState = storage.getItem(name);
13
13
  if (storedState) {
14
14
  try {
15
- const { state: persistedState, version: persistedVersion } = JSON.parse(storedState);
16
- if (persistedVersion === version) {
17
- store.setState(Object.assign(store.getInitialState(), persistedState));
18
- }
19
- else if (onVersionChanged) {
20
- onVersionChanged(persistedVersion);
21
- }
15
+ const { state: persistedState } = JSON.parse(storedState);
16
+ store.setState(Object.assign(store.getInitialState(), persistedState));
22
17
  }
23
18
  catch (error) {
24
19
  logger.error('Failed to load state from storage', error);