From 3cc53de1b3938ea5af490ad555ac344e22fc6430 Mon Sep 17 00:00:00 2001 From: Venix <30481900+venix12@users.noreply.github.com> Date: Sat, 23 Dec 2023 03:59:24 +0100 Subject: [PATCH] update initialVote on submit --- resources/js/contest-judge/entry.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/js/contest-judge/entry.tsx b/resources/js/contest-judge/entry.tsx index 86d3ad463e2..5bbf16685c8 100644 --- a/resources/js/contest-judge/entry.tsx +++ b/resources/js/contest-judge/entry.tsx @@ -24,7 +24,7 @@ interface Props { @observer export default class Entry extends React.Component { @observable private comment: string; - private readonly initialVote?: ContestJudgeVoteJson; + @observable private initialVote?: ContestJudgeVoteJson; @observable private posting = false; @observable private readonly scores: ContestJudgeScoreJson[]; @observable private xhr?: JQuery.jqXHR; @@ -182,6 +182,7 @@ export default class Entry extends React.Component { .fail(onError) .done((json: ContestEntryJson) => runInAction(() => { this.props.store.update(json); + this.initialVote = json.current_user_judge_vote; })).always(action(() => { this.posting = false; this.xhr = undefined;