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:
Phillip Thelen
2026-01-21 20:57:42 +01:00
committed by GitHub
parent 005d14f6e8
commit f56708cd88
8 changed files with 86 additions and 20 deletions
+8 -4
View File
@@ -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);
}
}
}