fix unlock() to unpin bgs from full set (#13416)

This commit is contained in:
j-dover
2021-08-12 17:28:26 -04:00
committed by GitHub
parent bb8df83fb6
commit 45fa2a3221

View File

@@ -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);