mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 21:57: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) {
|
if (isFullSet) {
|
||||||
paths.forEach(pathPart => purchaseItem(pathPart, setType, user));
|
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 {
|
} else {
|
||||||
const [key, value] = splitPathItem(path);
|
const [key, value] = splitPathItem(path);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user