From ae9c21e3227b9d31b3428c3e9f56c77be6f713b3 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Mon, 21 Jul 2025 15:59:33 -0400 Subject: [PATCH] fix mandatory CW for notes erasiong content --- packages/backend/src/core/NoteEditService.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index f3825ca49a..6062e464ba 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -374,8 +374,6 @@ export class NoteEditService implements OnApplicationShutdown { if (data.text === '') { data.text = null; } - } else { - data.text = null; } const maxCwLength = user.host == null @@ -390,8 +388,6 @@ export class NoteEditService implements OnApplicationShutdown { if (data.cw === '') { data.cw = null; } - } else { - data.cw = null; } let tags = data.apHashtags; @@ -443,13 +439,13 @@ export class NoteEditService implements OnApplicationShutdown { } const update: Partial = {}; - if (data.text !== oldnote.text) { + if (data.text !== undefined && data.text !== oldnote.text) { update.text = data.text; } - if (data.cw !== oldnote.cw) { + if (data.cw !== undefined && data.cw !== oldnote.cw) { update.cw = data.cw; } - if (oldnote.hasPoll !== !!data.poll) { + if (data.poll !== undefined && oldnote.hasPoll !== !!data.poll) { update.hasPoll = !!data.poll; } if (data.mandatoryCW !== undefined && oldnote.mandatoryCW !== data.mandatoryCW) {