diff --git a/public/scripts/extensions/objective/index.js b/public/scripts/extensions/objective/index.js index 6785d5d3b..1b9a78284 100644 --- a/public/scripts/extensions/objective/index.js +++ b/public/scripts/extensions/objective/index.js @@ -17,6 +17,7 @@ let currentChatId = "" let currentObjective = null let currentTask = null let checkCounter = 0 +let lastMessageWasSwipe = false const defaultPrompts = { @@ -783,9 +784,12 @@ jQuery(() => { eventSource.on(event_types.CHAT_CHANGED, () => { resetState() }); - + eventSource.on(event_types.MESSAGE_SWIPED, () => { + lastMessageWasSwipe = true + }) eventSource.on(event_types.MESSAGE_RECEIVED, () => { - if (currentChatId == undefined || currentTask == undefined) { + if (currentChatId == undefined || jQuery.isEmptyObject(currentTask) || lastMessageWasSwipe) { + lastMessageWasSwipe = false return } if ($("#objective-check-frequency").val() > 0) {