mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-01 20:06:59 +01:00
Merge pull request #834 from ouoertheo/ouoertheo/objective-auto-check-fix
This commit is contained in:
commit
18e6e578dd
@ -107,6 +107,7 @@ async function checkTaskCompleted() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
checkCounter = $('#objective-check-frequency').val()
|
checkCounter = $('#objective-check-frequency').val()
|
||||||
|
toastr.info("Checking for task completion.")
|
||||||
|
|
||||||
const prompt = substituteParamsPrompts(objectivePrompts.checkTaskCompleted);
|
const prompt = substituteParamsPrompts(objectivePrompts.checkTaskCompleted);
|
||||||
const taskResponse = (await generateQuietPrompt(prompt)).toLowerCase()
|
const taskResponse = (await generateQuietPrompt(prompt)).toLowerCase()
|
||||||
@ -123,8 +124,10 @@ async function checkTaskCompleted() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getNextIncompleteTaskRecurse(task){
|
function getNextIncompleteTaskRecurse(task){
|
||||||
// Skip tasks with children, as they will have subtasks to determine completeness
|
if (task.completed === false // Return task if incomplete
|
||||||
if (task.completed === false && task.children.length === 0){
|
&& task.children.length === 0 // Ensure task has no children, it's subtasks will determine completeness
|
||||||
|
&& task.parentId // Must have parent id. Only root task will be missing this and we dont want that
|
||||||
|
){
|
||||||
return task
|
return task
|
||||||
}
|
}
|
||||||
for (const childTask of task.children) {
|
for (const childTask of task.children) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user