Added validation step to IA CDN server setting
This commit is contained in:
parent
e9c474eaf0
commit
306f22aa93
|
|
@ -75,7 +75,17 @@ class settingsPanel extends panelObj{
|
|||
* @param {Event} event - Event handed down by event listener
|
||||
*/
|
||||
updateIACDN(event){
|
||||
//If we hit enter
|
||||
if(event.key == "Enter"){
|
||||
//If we have an invalid server string
|
||||
if(!(this.IACDNInput.value.match(/^ia[0-9]{6}\...$/g) || this.IACDNInput.value == "")){
|
||||
//reset back to what was set before
|
||||
this.IACDNInput.value = localStorage.getItem('IACDN');
|
||||
|
||||
//BAIL!
|
||||
return;
|
||||
}
|
||||
|
||||
localStorage.setItem("IACDN", this.IACDNInput.value);
|
||||
client.processConfig("IACDN", this.IACDNInput.value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue