fix most customizations not being pinnable (#15578)
* fix most customizations not being pinnable * set correct pinTypes * fix(pinning): correct purchase types for base hair and mustaches * automatically unpin purchased customizations * ability to pin customization items * Fix pin not showing on buy modal * Pin on buy modal tweak --------- Co-authored-by: Kalista Payne <kalista@habitica.com> Co-authored-by: Hafiz <hafizbhamidi@gmail.com>
This commit is contained in:
@@ -288,14 +288,16 @@ export default async function unlock (user, req = {}, analytics) {
|
||||
if (isFullSet) {
|
||||
paths.forEach(pathPart => purchaseItem(pathPart, setType, user));
|
||||
|
||||
if (isBackground) {
|
||||
paths.forEach(pathPart => {
|
||||
paths.forEach(pathPart => {
|
||||
if (isBackground) {
|
||||
const [key, value] = splitPathItem(pathPart);
|
||||
const backgroundContent = content.backgroundsFlat[value];
|
||||
const itemInfo = getItemInfo(user, key, backgroundContent);
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
removeItemByPath(user, path);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const [key, value] = splitPathItem(path);
|
||||
|
||||
@@ -309,6 +311,8 @@ export default async function unlock (user, req = {}, analytics) {
|
||||
const backgroundContent = content.backgroundsFlat[value];
|
||||
const itemInfo = getItemInfo(user, 'background', backgroundContent);
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
} else {
|
||||
removeItemByPath(user, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user