diff --git a/Modules/QuestLinks/Hooks.lua b/Modules/QuestLinks/Hooks.lua index 425236f..6114b40 100644 --- a/Modules/QuestLinks/Hooks.lua +++ b/Modules/QuestLinks/Hooks.lua @@ -48,12 +48,21 @@ function Hooks:HookQuestLogTitle() local _, _, _, isHeader, _, _, _, questId = GetQuestLogTitle(questLogLineIndex) if questId and questId > 0 and not isHeader then -- Toggle tracking: if tracked, untrack; if untracked, track - if Questie.db.char.TrackedQuests[questId] or (Questie.db.profile.autoTrackQuests and not Questie.db.char.AutoUntrackedQuests[questId]) then + local isTracked = Questie.db.char.TrackedQuests[questId] or (Questie.db.profile.autoTrackQuests and not Questie.db.char.AutoUntrackedQuests[questId]) + if isTracked then -- Quest is currently tracked — untrack it - pcall(QuestieTracker.UntrackQuestId, QuestieTracker, questId) + Questie.db.char.TrackedQuests[questId] = nil + Questie.db.char.AutoUntrackedQuests[questId] = nil + QuestieCombatQueue:Queue(function() + QuestieTracker:Update() + end) else -- Quest is currently untracked — track it - pcall(QuestieTracker.AQW_Insert, QuestieTracker, questLogLineIndex, QUEST_WATCH_NO_EXPIRE) + Questie.db.char.TrackedQuests[questId] = true + Questie.db.char.AutoUntrackedQuests[questId] = nil + QuestieCombatQueue:Queue(function() + QuestieTracker:Update() + end) end end if WatchFrame_Update then