Browse Source

login form

master
f0x 1 week ago
parent
commit
74af813e6b
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      components/Login.js

+ 3
- 2
components/Login.js View File

@@ -49,7 +49,7 @@ let login = create({
49 49
       this.doLogin()
50 50
     }).catch((error) => {
51 51
       console.log("ERROR fetching homeserver url", error)
52
-      let hsState = Object.assign(this.state.hs, {error: error, valid: false})
52
+      let hsState = Object.assign(this.state.hs, {error: error, valid: false, prompt: true})
53 53
       this.setState({hs: hsState})
54 54
     })
55 55
   },
@@ -113,6 +113,7 @@ let login = create({
113 113
     let formState = this.state.formState
114 114
     formState.hs = e.target.value
115 115
     this.setState({formState: formState})
116
+    this.setState({hs: {error: null, valid: false, prompt: true, changed: true}})
116 117
   },
117 118
 
118 119
   render: function() {
@@ -141,7 +142,7 @@ let login = create({
141 142
           <label htmlFor="hs" className={hsState}>Homeserver: </label>
142 143
           {this.state.hs.prompt ? (
143 144
             <>
144
-              <input type="text" id="hs" placeholder="https://lain.haus" value={this.state.formState["hs"]} onChange={this.handleHsChange}/>
145
+              <input type="text" id="hs" value={this.state.formState["hs"]} onChange={this.handleHsChange}/>
145 146
             </>
146 147
           ) : (
147 148
             <span id="hs">{this.state.formState["hs"]}</span>

Loading…
Cancel
Save