From 6bb383a4a51a852087c6eb212c658c98f5f4c2d5 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 3 Feb 2026 23:55:07 +0800 Subject: [PATCH] fix: prevent CTRL+Enter save while editor is loading content (#5581) - Add validation check for loading state before allowing save - Prevents false "Content, attachment, or file required" error - Occurs when user presses CTRL+Enter immediately after opening edit mode - Editor state may still be loading when keyboard shortcut fires Closes #5581 --- web/src/components/MemoEditor/services/validationService.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/components/MemoEditor/services/validationService.ts b/web/src/components/MemoEditor/services/validationService.ts index 1f2ac06ba..139348ab1 100644 --- a/web/src/components/MemoEditor/services/validationService.ts +++ b/web/src/components/MemoEditor/services/validationService.ts @@ -7,6 +7,11 @@ export interface ValidationResult { export const validationService = { canSave(state: EditorState): ValidationResult { + // Cannot save while loading initial content + if (state.ui.isLoading.loading) { + return { valid: false, reason: "Loading memo content" }; + } + // Must have content, attachment, or local file if (!state.content.trim() && state.metadata.attachments.length === 0 && state.localFiles.length === 0) { return { valid: false, reason: "Content, attachment, or file required" };