Skip to content

Commit

Permalink
chore: rename types
Browse files Browse the repository at this point in the history
  • Loading branch information
Ross Bulat committed Oct 25, 2023
1 parent 60eed16 commit 9960a1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/contexts/ActiveAccounts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ export const ActiveAccountsProvider = ({
// Setter for the active account.
const setActiveAccount = (
newActiveAccount: MaybeAddress,
local: boolean = true
updateLocalStorage: boolean = true
) => {
if (local)
if (newActiveAccount === null) {
if (updateLocalStorage)
if (newActiveAccount === null)
localStorage.removeItem(`${network}_active_account`);
} else {
localStorage.setItem(`${network}_active_account`, newActiveAccount);
}
else localStorage.setItem(`${network}_active_account`, newActiveAccount);

setStateWithRef(newActiveAccount, setActiveAccountState, activeAccountRef);
};

Expand Down
7 changes: 5 additions & 2 deletions src/contexts/ActiveAccounts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ export interface ActiveAccountsContextInterface {
activeProxy: MaybeAddress;
activeProxyType: string | null;
getActiveAccount: () => string | null;
setActiveAccount: (address: MaybeAddress, updateLocal?: boolean) => void;
setActiveProxy: (address: ActiveProxy, updateLocal?: boolean) => void;
setActiveAccount: (
address: MaybeAddress,
updateLocalStorage?: boolean
) => void;
setActiveProxy: (address: ActiveProxy, updateLocalStorage?: boolean) => void;
}

export type ActiveProxy = {
Expand Down

0 comments on commit 9960a1d

Please sign in to comment.