don't duplicate mandatory CWs
This commit is contained in:
@@ -371,10 +371,10 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||||||
|
|
||||||
// Apply mandatory CW, if applicable
|
// Apply mandatory CW, if applicable
|
||||||
if (user.mandatoryCW) {
|
if (user.mandatoryCW) {
|
||||||
if (data.cw) {
|
if (!data.cw) {
|
||||||
data.cw += `, ${user.mandatoryCW}`;
|
|
||||||
} else {
|
|
||||||
data.cw = user.mandatoryCW;
|
data.cw = user.mandatoryCW;
|
||||||
|
} else if (!data.cw.includes(user.mandatoryCW)) {
|
||||||
|
data.cw += `, ${user.mandatoryCW}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -399,10 +399,10 @@ export class NoteEditService implements OnApplicationShutdown {
|
|||||||
|
|
||||||
// Apply mandatory CW, if applicable
|
// Apply mandatory CW, if applicable
|
||||||
if (user.mandatoryCW) {
|
if (user.mandatoryCW) {
|
||||||
if (data.cw) {
|
if (!data.cw) {
|
||||||
data.cw += `, ${user.mandatoryCW}`;
|
|
||||||
} else {
|
|
||||||
data.cw = user.mandatoryCW;
|
data.cw = user.mandatoryCW;
|
||||||
|
} else if (!data.cw.includes(user.mandatoryCW)) {
|
||||||
|
data.cw += `, ${user.mandatoryCW}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user