mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
fix unlock() to unpin bgs from full set (#13416)
This commit is contained in:
@@ -275,6 +275,15 @@ export default function unlock (user, req = {}, analytics) {
|
||||
|
||||
if (isFullSet) {
|
||||
paths.forEach(pathPart => purchaseItem(pathPart, setType, user));
|
||||
|
||||
if (isBackground) {
|
||||
paths.forEach(pathPart => {
|
||||
const [key, value] = splitPathItem(pathPart);
|
||||
const backgroundContent = content.backgroundsFlat[value];
|
||||
const itemInfo = getItemInfo(user, key, backgroundContent);
|
||||
removeItemByPath(user, itemInfo.path);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
const [key, value] = splitPathItem(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user