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:
1 file changed
+3
-1
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user