Commit e138e0ec authored by lynn's avatar lynn Committed by GitHub

fix: don't open bag automatically when removing items (#5452)

fix
parent 60bd2db4
...@@ -68,7 +68,7 @@ export const useBag = create<BagState>()( ...@@ -68,7 +68,7 @@ export const useBag = create<BagState>()(
})), })),
itemsInBag: [], itemsInBag: [],
setItemsInBag: (items) => setItemsInBag: (items) =>
set(({ bagManuallyClosed }) => ({ set(() => ({
itemsInBag: items, itemsInBag: items,
})), })),
totalEthPrice: BigNumber.from(0), totalEthPrice: BigNumber.from(0),
...@@ -118,7 +118,7 @@ export const useBag = create<BagState>()( ...@@ -118,7 +118,7 @@ export const useBag = create<BagState>()(
} }
}), }),
removeAssetsFromBag: (assets, fromSweep = false) => { removeAssetsFromBag: (assets, fromSweep = false) => {
set(({ bagManuallyClosed, itemsInBag }) => { set(({ itemsInBag }) => {
if (get().isLocked) return { itemsInBag: get().itemsInBag } if (get().isLocked) return { itemsInBag: get().itemsInBag }
if (itemsInBag.length === 0) return { itemsInBag: [] } if (itemsInBag.length === 0) return { itemsInBag: [] }
const itemsCopy = itemsInBag.filter( const itemsCopy = itemsInBag.filter(
...@@ -132,7 +132,6 @@ export const useBag = create<BagState>()( ...@@ -132,7 +132,6 @@ export const useBag = create<BagState>()(
return { return {
itemsInBag: itemsCopy, itemsInBag: itemsCopy,
usedSweep: fromSweep, usedSweep: fromSweep,
bagExpanded: itemsCopy.length !== 0,
} }
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment