From 45fa2a3221e094f3c733294f20fe309e00efee58 Mon Sep 17 00:00:00 2001 From: j-dover Date: Thu, 12 Aug 2021 17:28:26 -0400 Subject: [PATCH] fix unlock() to unpin bgs from full set (#13416) --- website/common/script/ops/unlock.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/common/script/ops/unlock.js b/website/common/script/ops/unlock.js index 21fef138f5..d9b7ddd72f 100644 --- a/website/common/script/ops/unlock.js +++ b/website/common/script/ops/unlock.js @@ -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);