mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-04-28 09:36:56 +00:00
don't duplicate mandatory CWs
This commit is contained in:
parent
568d82a974
commit
b256ac32d0
2 changed files with 6 additions and 6 deletions
|
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue