diff options
author | joffrey-bion <joffrey.bion@gmail.com> | 2019-10-23 02:13:33 +0200 |
---|---|---|
committer | joffrey-bion <joffrey.bion@gmail.com> | 2019-10-23 02:13:33 +0200 |
commit | b8a047a2883bd604c2225b6e08ad81e5f98784e4 (patch) | |
tree | 62463ee9be9118f3568d8f828788063dd791f02b | |
parent | Sagas rework (diff) | |
download | seven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.tar.gz seven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.tar.bz2 seven-wonders-b8a047a2883bd604c2225b6e08ad81e5f98784e4.zip |
WIP name form fix
-rw-r--r-- | sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt index 30a0883a..11f52529 100644 --- a/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt +++ b/sw-ui-kt/src/main/kotlin/org/luxons/sevenwonders/ui/components/home/ChooseNameForm.kt @@ -16,10 +16,14 @@ private interface ChooseNameFormProps: RProps { var chooseUsername: (String) -> Unit } -private data class ChooseNameFormState(val username: String): RState +private data class ChooseNameFormState(var username: String = ""): RState private class ChooseNameForm(props: ChooseNameFormProps): RComponent<ChooseNameFormProps, ChooseNameFormState>(props) { + override fun ChooseNameFormState.init(props: ChooseNameFormProps) { + username = "" + } + override fun RBuilder.render() { form { attrs.onSubmitFunction = { props.chooseUsername(state.username) } |