Skip to content

Commit

Permalink
invalidate all stake token amounts when changing either token
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Dec 17, 2024
1 parent ad299e2 commit d6e9dca
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions web/src/stores/useStakeStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,26 @@ export const useStakeStore = create<StakeStore>((set) => ({
setMultiSingleToken: (multiSingleToken) => set({ multiSingleToken }),

token0: EmptyToken,
setToken0: (token0) => set({ token0 }),
// changing token invalidates all amounts
setToken0: (token0) =>
set({
token0,
token0Amount: "0",
token0AmountRaw: "0",
token1Amount: "0",
token1AmountRaw: "0",
}),

token1: EmptyToken,
setToken1: (token1) => set({ token1 }),
// changing token invalidates all amounts
setToken1: (token1) =>
set({
token1,
token0Amount: "0",
token0AmountRaw: "0",
token1Amount: "0",
token1AmountRaw: "0",
}),

token0Amount: "",
token1Amount: "",
Expand Down

0 comments on commit d6e9dca

Please sign in to comment.