allowing change if undefined or null

This commit is contained in:
Miodec 2023-06-14 23:56:39 +02:00
parent 6a0ba9d64d
commit 242e017371

View file

@ -840,7 +840,10 @@ export async function setStreakHourOffset(
const user = await UserDAL.getUser(uid, "update user profile");
if (user.streak?.hourOffset !== undefined) {
if (
user.streak?.hourOffset !== undefined &&
user.streak?.hourOffset !== null
) {
throw new MonkeyError(403, "Streak hour offset already set");
}