Skip to content

Commit

Permalink
refactor: cache all swap widget states
Browse files Browse the repository at this point in the history
Signed-off-by: Griko Nibras <griko@nibras.co>
  • Loading branch information
grikomsn committed Jan 24, 2024
1 parent d64f05e commit ee8a2bc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/components/SwapWidget/useSwapWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,16 +775,8 @@ const useSwapWidgetStore = create(
subscribeWithSelector(
persist(() => defaultValues, {
name: "SwapWidgetState",
version: 1,
version: 2,
storage: createJSONStorage(() => window.sessionStorage),
partialize: (state): Partial<SwapWidgetStore> => ({
amountIn: state.amountIn,
amountOut: state.amountOut,
sourceChain: state.sourceChain,
sourceAsset: state.sourceAsset,
destinationChain: state.destinationChain,
destinationAsset: state.destinationAsset,
}),
skipHydration: true,
}),
),
Expand Down

0 comments on commit ee8a2bc

Please sign in to comment.