Skip to content

Commit

Permalink
fix: issue with token store migration (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
VGau authored Nov 28, 2024
1 parent 7f95ae9 commit 8226d2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bridge-ui/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ NEXT_PUBLIC_INFURA_ID=<GITHUB_SECRET>

E2E_TEST_PRIVATE_KEY=<GITHUB_SECRET>

NEXT_PUBLIC_STORAGE_MIN_VERSION="2"
NEXT_PUBLIC_STORAGE_MIN_VERSION="3"
2 changes: 1 addition & 1 deletion bridge-ui/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NEXT_PUBLIC_INFURA_ID=<YOUR_INFURA_ID>

E2E_TEST_PRIVATE_KEY=<YOUR_PRIVATE_KEY>

NEXT_PUBLIC_STORAGE_MIN_VERSION="2"
NEXT_PUBLIC_STORAGE_MIN_VERSION="3"

E2E_TEST_SEED_PHRASE="test test test test test test test test test test test junk"
E2E_TEST_WALLET_PASSWORD="TestPassword!"
8 changes: 4 additions & 4 deletions bridge-ui/src/stores/tokenStore.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createWithEqualityFn } from "zustand/traditional";
import { shallow } from "zustand/vanilla/shallow";

import { config, NetworkTokens, NetworkType, TokenInfo, TokenType } from "@/config";
import { createJSONStorage, persist } from "zustand/middleware";
import { config, NetworkTokens, NetworkType, TokenInfo, TokenType } from "@/config";
import { getTokenConfig } from "@/services/tokenService";

export const defaultTokensConfig: NetworkTokens = {
MAINNET: [
Expand Down Expand Up @@ -94,8 +94,8 @@ export const createTokenStore = (initState: TokenState = defaultInitState) => {
name: "token-storage", // name of the item in the storage (must be unique)
storage: createJSONStorage(() => localStorage),
version: parseInt(config.storage.minVersion),
migrate: () => {
return defaultInitState;
migrate: async () => {
return getTokenConfig();
},
},
),
Expand Down

0 comments on commit 8226d2c

Please sign in to comment.