mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-02 04:00:36 +00:00
Reset market on gear purchase (#9855)
This commit is contained in:
parent
803f63d991
commit
027eed1b25
1 changed files with 8 additions and 0 deletions
|
|
@ -14,8 +14,16 @@ import { getDropClass } from 'client/libs/notifications';
|
|||
export function buyItem (store, params) {
|
||||
const quantity = params.quantity || 1;
|
||||
const user = store.state.user.data;
|
||||
|
||||
const userPinned = user.pinnedItems.slice();
|
||||
let opResult = buyOp(user, {params, quantity});
|
||||
|
||||
// @TODO: Currently resetting the pinned items will reset the market. Purchasing some items does not reset pinned.
|
||||
// For now, I've added this hack for items like contributor gear to update while I am working on add more computed
|
||||
// properties to the market. We will use this quick fix while testing the other changes.
|
||||
user.pinnedItems = userPinned;
|
||||
|
||||
|
||||
return {
|
||||
result: opResult,
|
||||
httpCall: axios.post(`/api/v3/user/buy/${params.key}`),
|
||||
|
|
|
|||
Loading…
Reference in a new issue