snapshot_poker_uiux_cleanup_2

This commit is contained in:
DeSqBlocki
2026-09-08 21:05:52 +02:00
parent 82cef1b34a
commit c61e34c241
6 changed files with 475 additions and 0 deletions
+41
View File
@@ -470,6 +470,46 @@ async function changeCookiesOnce(
}
async function clearCookieOperation(
userId,
operationId
) {
if (
typeof operationId !==
"string"
||
!/^[A-Za-z0-9:_-]{1,160}$/.test(
operationId
)
) {
throw new Error(
"INVALID_COOKIE_OPERATION_ID"
);
}
const {
cookies
} =
getCollections();
const result =
await cookies.updateOne(
{
userId
},
{
$pull: {
appliedCookieOperations:
operationId
}
}
);
return result.modifiedCount ===
1;
}
async function hasCookieOperation(
userId,
operationId
@@ -1435,6 +1475,7 @@ module.exports = {
changeCookies,
changeCookiesOnce,
hasCookieOperation,
clearCookieOperation,
transferCookies,
getCooldown,