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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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