aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/StyleProviderQuiz.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/StyleProviderQuiz.tsx b/src/client/views/StyleProviderQuiz.tsx
index 0268771ff..4e845f9f5 100644
--- a/src/client/views/StyleProviderQuiz.tsx
+++ b/src/client/views/StyleProviderQuiz.tsx
@@ -19,6 +19,7 @@ import { ImageBox } from './nodes/ImageBox';
import { ImageUtility } from './nodes/imageEditor/imageEditorUtils/ImageHandler';
import './StyleProviderQuiz.scss';
import { Networking } from '../Network';
+import { runInAction } from 'mobx';
export namespace styleProviderQuiz {
enum quizMode {
@@ -83,14 +84,14 @@ export namespace styleProviderQuiz {
imgBox.Document._quizMode = quiz;
const quizBoxes = DocListCast(imgBox.Document.quizBoxes);
if (!quizBoxes.length) {
- imgBox.Loading = true;
+ runInAction(() => (imgBox.Loading = true));
const response = (await Networking.PostToServer('/labels', { file: i ? i : imgBox.paths[0], drag: i ? 'drag' : 'full', smart: quiz })) as { result: string };
const parsedResponse = JSON.parse(response.result.replace(/'/g, '"'));
if (parsedResponse['boxes'].length != 0) {
createBoxes(imgBox, parsedResponse['boxes'], parsedResponse['text']);
}
- imgBox.Loading = false;
+ runInAction(() => (imgBox.Loading = false));
} else quizBoxes.forEach(box => (box.hidden = false));
}