fix: 🐛 remove cw in post edit

Closes #10353
This commit is contained in:
ThatOneCalculator 2023-06-23 21:18:04 -07:00
parent 0e4a4b09c9
commit 1fddd319c4
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -527,9 +527,12 @@ export default define(meta, paramDef, async (ps, user) => {
if (ps.text !== note.text) { if (ps.text !== note.text) {
update.text = ps.text; update.text = ps.text;
} }
if (ps.cw !== note.cw) { if (ps.cw !== note.cw || (ps.cw && !note.cw)) {
update.cw = ps.cw; update.cw = ps.cw;
} }
else if (!ps.cw && note.cw) {
update.cw = null;
}
if (ps.visibility !== note.visibility) { if (ps.visibility !== note.visibility) {
update.visibility = ps.visibility; update.visibility = ps.visibility;
} }