Skip to content

Commit

Permalink
Merge pull request #14885 from allanjoseph98/spinner-fix
Browse files Browse the repository at this point in the history
Use existing json data to determine if analysis is completed
  • Loading branch information
ornicar committed Mar 16, 2024
2 parents 9949d9f + bc14c94 commit d78a422
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions ui/analyse/src/study/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export interface StudyChapter {
}

export interface StudyChapterServerEval {
done: boolean;
path: string;
}

Expand Down
9 changes: 5 additions & 4 deletions ui/analyse/src/study/serverEval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export default class ServerEval {
constructor(
readonly root: AnalyseCtrl,
readonly chapterId: () => string,
) {}
) {
site.pubsub.on('analysis.server.progress', this.updateChart);
}

reset = () => {
this.requested = false;
Expand Down Expand Up @@ -46,9 +48,8 @@ export function view(ctrl: ServerEval): VNode {
}),
});

site.pubsub.on('analysis.server.progress', ctrl.updateChart);

const loading = mainline.find(ctrl.root.partialAnalysisCallback);
const loading =
!ctrl.root.study?.data.chapter?.serverEval?.done && mainline.find(ctrl.root.partialAnalysisCallback);
return h('div.study__server-eval.ready.', loading ? [chart, chartSpinner()] : chart);
}

Expand Down

0 comments on commit d78a422

Please sign in to comment.