Reset market on gear purchase (#9855)

This commit is contained in:
Keith Holliday 2018-02-02 11:22:25 -07:00 committed by GitHub
parent 803f63d991
commit 027eed1b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`),