From 5f16c05cfda5b11ba1ccf59cae1215145275af1d Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Thu, 14 Mar 2024 11:16:24 +0100 Subject: [PATCH] Revert "tweak studyCtrl.setChapter" This reverts commit b87f44f0600f0b4ecf0e34e2f01a923b35c120e7. --- ui/analyse/src/study/studyCtrl.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/ui/analyse/src/study/studyCtrl.ts b/ui/analyse/src/study/studyCtrl.ts index 71294e5b67d0..08e18d8372b6 100644 --- a/ui/analyse/src/study/studyCtrl.ts +++ b/ui/analyse/src/study/studyCtrl.ts @@ -444,13 +444,12 @@ export default class StudyCtrl { likeToggler = debounce(() => this.send('like', { liked: this.data.liked }), 1000); setChapter = (id: string, force?: boolean) => { - if (id === this.vm.chapterId && !force) { - if (this.relay?.tourShow()) { - this.relay?.tourShow(false); - this.redraw(); - } - return; + const alreadySet = id === this.vm.chapterId && !force; + if (this.relay?.tourShow()) { + this.relay.tourShow(false); + if (alreadySet) this.redraw(); } + if (alreadySet) return; if (!this.vm.mode.sticky || !this.makeChange('setChapter', id)) { this.vm.mode.sticky = false; if (!this.vm.behind) this.vm.behind = 1;