fix: continue writing empty text case (#7574)

This commit is contained in:
Richard Shiue 2025-03-19 14:13:20 +08:00 committed by GitHub
parent 8a9cc278ec
commit 461ac91b32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,7 +318,7 @@ class AiWriterCubit extends Cubit<AiWriterState> {
end: cursorPosition,
).normalized;
String text = await editorState.getMarkdownInSelection(selection);
String text = (await editorState.getMarkdownInSelection(selection)).trim();
if (text.isEmpty) {
if (state is! ReadyAiWriterState) {
return;