fix bug when switching to a study chapter without analysis

pull/4139/head
Thibault Duplessis 2018-03-14 11:08:36 -05:00
parent 1bb169efd5
commit a55fb7dcc0
1 changed files with 4 additions and 2 deletions

View File

@ -77,8 +77,10 @@ export function view(ctrl: ServerEvalCtrl): VNode {
ctrl.lastPly(false);
li.requestIdleCallback(() => {
li.loadScript('/assets/javascripts/chart/acpl.js').then(() => {
li.advantageChart(ctrl.root.data, ctrl.root.trans, vnode.elm as HTMLElement);
ctrl.chartEl(vnode.elm as HTMLElement);
if (ctrl.root.data.analysis) {
li.advantageChart(ctrl.root.data, ctrl.root.trans, vnode.elm as HTMLElement);
ctrl.chartEl(vnode.elm as HTMLElement);
}
});
});
}