diff --git a/ui/analyse/src/study/studyCtrl.ts b/ui/analyse/src/study/studyCtrl.ts index 7a728e42d766..83a4caa5c650 100644 --- a/ui/analyse/src/study/studyCtrl.ts +++ b/ui/analyse/src/study/studyCtrl.ts @@ -1,6 +1,6 @@ import type { DrawShape } from 'chessground/draw'; import { prop, defined } from 'common'; -import { debounce, throttle, throttlePromise } from 'common/timing'; +import { debounce, throttle, throttlePromiseDelay } from 'common/timing'; import type AnalyseCtrl from '../ctrl'; import { StudyMemberCtrl } from './studyMembers'; import StudyPracticeCtrl from './practice/studyPracticeCtrl'; @@ -377,17 +377,20 @@ export default class StudyCtrl { this.updateAddressBar(); }; - xhrReload = throttlePromise((withChapters: boolean = false) => { - this.vm.loading = true; - return xhr - .reload( - this.practice ? 'practice/load' : 'study', - this.data.id, - this.vm.mode.sticky ? undefined : this.vm.chapterId, - (withChapters = withChapters), - ) - .then(this.onReload, site.reload); - }); + xhrReload = throttlePromiseDelay( + () => 500, + (withChapters: boolean = false) => { + this.vm.loading = true; + return xhr + .reload( + this.practice ? 'practice/load' : 'study', + this.data.id, + this.vm.mode.sticky ? undefined : this.vm.chapterId, + (withChapters = withChapters), + ) + .then(this.onReload, site.reload); + }, + ); onSetPath = throttle(300, (path: Tree.Path) => { if (this.vm.mode.sticky && path !== this.data.position.path)