don't duplicate mandatory CWs

This commit is contained in:
Hazelnoot 2025-01-28 13:08:56 -05:00
parent 568d82a974
commit b256ac32d0
2 changed files with 6 additions and 6 deletions

View file

@ -371,10 +371,10 @@ export class NoteCreateService implements OnApplicationShutdown {
// Apply mandatory CW, if applicable
if (user.mandatoryCW) {
if (data.cw) {
data.cw += `, ${user.mandatoryCW}`;
} else {
if (!data.cw) {
data.cw = user.mandatoryCW;
} else if (!data.cw.includes(user.mandatoryCW)) {
data.cw += `, ${user.mandatoryCW}`;
}
}

View file

@ -399,10 +399,10 @@ export class NoteEditService implements OnApplicationShutdown {
// Apply mandatory CW, if applicable
if (user.mandatoryCW) {
if (data.cw) {
data.cw += `, ${user.mandatoryCW}`;
} else {
if (!data.cw) {
data.cw = user.mandatoryCW;
} else if (!data.cw.includes(user.mandatoryCW)) {
data.cw += `, ${user.mandatoryCW}`;
}
}