mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Fix random activation of objectives
This commit is contained in:
		| @@ -116,7 +116,7 @@ async function generateTasks() { | |||||||
| // Call Quiet Generate to check if a task is completed | // Call Quiet Generate to check if a task is completed | ||||||
| async function checkTaskCompleted() { | async function checkTaskCompleted() { | ||||||
|     // Make sure there are tasks and check is enabled |     // Make sure there are tasks and check is enabled | ||||||
|     if (currentTask == {} || $('#objective-check-frequency').val() == 0) { |     if (Object.keys(currentTask).length == 0 || $('#objective-check-frequency').val() == 0) { | ||||||
|         return |         return | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -144,7 +144,7 @@ async function checkTaskCompleted() { | |||||||
| // Set a task in extensionPrompt context. Defaults to first incomplete | // Set a task in extensionPrompt context. Defaults to first incomplete | ||||||
| function setCurrentTask(index = null) { | function setCurrentTask(index = null) { | ||||||
|     const context = getContext(); |     const context = getContext(); | ||||||
|     let currentTask = {}; |     currentTask = {}; | ||||||
|  |  | ||||||
|     if (index === null) { |     if (index === null) { | ||||||
|         currentTask = globalTasks.find(task => !task.completed) || {}; |         currentTask = globalTasks.find(task => !task.completed) || {}; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user