From 7b4e287b1020c9c3d0532252e88603927459ce06 Mon Sep 17 00:00:00 2001 From: SillyLossy Date: Thu, 1 Jun 2023 23:59:42 +0300 Subject: [PATCH] Fix random activation of objectives --- public/scripts/extensions/objective/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/extensions/objective/index.js b/public/scripts/extensions/objective/index.js index 857387449..1a21b4aae 100644 --- a/public/scripts/extensions/objective/index.js +++ b/public/scripts/extensions/objective/index.js @@ -116,7 +116,7 @@ async function generateTasks() { // Call Quiet Generate to check if a task is completed async function checkTaskCompleted() { // 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 } @@ -144,7 +144,7 @@ async function checkTaskCompleted() { // Set a task in extensionPrompt context. Defaults to first incomplete function setCurrentTask(index = null) { const context = getContext(); - let currentTask = {}; + currentTask = {}; if (index === null) { currentTask = globalTasks.find(task => !task.completed) || {};