diff options
author | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2023-02-03 14:59:17 +0100 |
---|---|---|
committer | Erich Eckner <erich.eckner.ext@bestsecret.com> | 2023-02-03 14:59:17 +0100 |
commit | 75cb5952f4585a129ab763de3c6a1ca499d1d452 (patch) | |
tree | 83cb55b8b8f446ac75d14ea2bb12263af5ea742a /src/Wordle.vue | |
parent | 51fcd1cf5d45eea38f4a5ec164725b3023dcd2e4 (diff) | |
download | wordle-frontend-75cb5952f4585a129ab763de3c6a1ca499d1d452.tar.xz |
hand through the colors to Trial, properly create new lines when new trial starts
Diffstat (limited to 'src/Wordle.vue')
-rw-r--r-- | src/Wordle.vue | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/Wordle.vue b/src/Wordle.vue index 4f3c32c..c57f0fa 100644 --- a/src/Wordle.vue +++ b/src/Wordle.vue @@ -21,7 +21,12 @@ import Trials from "@/components/Trials.vue"; let riddle: string = ""; let current = reactive({ trial: "", - backendResponse: {}, + backendResponse: { + trial: "", + is_in_dictionary: true, + is_solved: false, + colors: [], + }, }); let props = defineProps<{ length: number }>(); @@ -53,6 +58,9 @@ function submit() { xmlHttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { current.backendResponse = JSON.parse(xmlHttp.responseText); + if (current.backendResponse.is_in_dictionary) { + current.trial = ""; + } } }; xmlHttp.open( |