Skip to content

Commit

Permalink
fix guardian local storage entry bug
Browse files Browse the repository at this point in the history
  • Loading branch information
juliancwirko committed Oct 2, 2023
1 parent bbad2d9 commit 042b9ee
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### [0.9.5](https://github.com/useElven/core/releases/tag/v0.9.5) (2023-10-02)
- fix the bug related to reseting the active guardian local storage entry on hard refresh
- update dependencies

### [0.9.4](https://github.com/useElven/core/releases/tag/v0.9.4) (2023-09-30)
- export `TransactionParams` type
- update dependencies
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@useelven/core",
"version": "0.9.4",
"version": "0.9.5",
"description": "Core hooks for MultiversX React DApps",
"license": "MIT",
"author": "Julian Ćwirko <julian.io>",
Expand Down Expand Up @@ -77,7 +77,7 @@
"devDependencies": {
"@types/lodash.clonedeep": "4.5.7",
"@types/node": "20.8.0",
"@types/react": "18.2.23",
"@types/react": "18.2.24",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"eslint": "8.50.0",
Expand Down
5 changes: 5 additions & 0 deletions src/hooks/common-helpers/useLocalStorageSync.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export const useLocalStorageSync = (
setAccountState('nonce', parsedStorage.nonce);
setAccountState('balance', parsedStorage.balance);
setAccountState('addressIndex', parsedStorage.addressIndex);
setAccountState(
'activeGuardianAddress',
parsedStorage.activeGuardianAddress
);
setAccountDone(true);
}, []);

Expand All @@ -53,6 +57,7 @@ export const useLocalStorageSync = (
accountSnap.nonce,
accountSnap.balance,
accountSnap.addressIndex,
accountSnap.activeGuardianAddress,
]);

useEffectOnlyOnUpdate(() => {
Expand Down

0 comments on commit 042b9ee

Please sign in to comment.