Compare commits
2 commits
ff427d0354
...
c8351e8f0c
Author | SHA1 | Date | |
---|---|---|---|
c8351e8f0c | |||
cf2c691585 |
2 changed files with 14 additions and 8 deletions
|
@ -50,12 +50,12 @@ class Feedback extends ElemJS {
|
|||
this.loading = state
|
||||
}
|
||||
|
||||
message(content) {
|
||||
if (content) {
|
||||
this.class("form-feedback")
|
||||
} else {
|
||||
message(content, isError) {
|
||||
this.removeClass("form-feedback")
|
||||
}
|
||||
this.removeClass("form-error")
|
||||
if (content) this.class("form-feedback")
|
||||
if(isError) this.class("form-error")
|
||||
|
||||
this.messageSpan.text(content)
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,10 @@ class Form extends ElemJS {
|
|||
let currentAddress = homeserver.value
|
||||
let ok = false
|
||||
while (!ok) {
|
||||
if (!currentAddress.match(/^https?:\/\//)) currentAddress = "https://" + currentAddress
|
||||
if (!currentAddress.match(/^https?:\/\//)) {
|
||||
console.warn(`${currentAddress} doesn't specify the protocol, assuming https`)
|
||||
currentAddress = "https://" + currentAddress
|
||||
}
|
||||
currentAddress = currentAddress.replace(/\/*$/, "")
|
||||
this.status(`Looking up homeserver... trying ${currentAddress}`)
|
||||
try {
|
||||
|
@ -141,7 +144,7 @@ class Form extends ElemJS {
|
|||
cancel(message) {
|
||||
this.processing = false
|
||||
feedback.setLoading(false)
|
||||
feedback.message(message)
|
||||
feedback.message(message, true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
width: 100%
|
||||
margin: -0.5em 0 -0.8em
|
||||
|
||||
.form-error
|
||||
color: red
|
||||
|
||||
@keyframes spin
|
||||
0%
|
||||
transform: rotate(0deg)
|
||||
|
|
Loading…
Reference in a new issue