Skip to content

Commit b451be6

Browse files
authored
fix: zap out price invert (#2869)
1 parent 378594e commit b451be6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/zap-out-widgets/src/stores/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ const createZapOutStore = (initProps: InnerZapOutProps) => {
103103

104104
set({ errorMsg: 'Invalid pool type' });
105105
},
106-
toggleRevertPrice: () => set(state => ({ revertPrice: !state.revertPrice })),
106+
toggleRevertPrice: () => {
107+
set(state => ({ revertPrice: !state.revertPrice }));
108+
109+
const { pool, revertPrice } = get();
110+
const price = getPoolPrice({ pool, revertPrice });
111+
if (price !== null) set({ poolPrice: price });
112+
},
107113
setWidgetError: (error: string) => set({ widgetError: error }),
108114
}));
109115
};

0 commit comments

Comments
 (0)