Fixes timed prompts generation race condition

Reorders initialization of in-progress flag to prevent potential race conditions during timed prompt generation

Ensures that the in-progress status is set before stopping existing sequences and generates prompts
This commit is contained in:
AlexKucera committed 2025-10-24 12:59:19 +02:00
1 parent 6ccfb9e023
commit 92e109e2e8
1 file changed
+3 -1
+3 -1
View File
@@ -21,11 +21,13 @@ export class TimedPromptsCommand {
new Notice('Timed prompts are already being generated. Please wait.');
return;
}
this.inProgress = true;
// Stop any existing timed sequence
this.stop();
this.inProgress = true;
try {
// Generate prompts
const prompts = await this.promptGenerator.generateTimedPrompts(settings);