fixed first-run contextmenu

master
and94x 2 years ago
parent 659068abee
commit 09e788a37e

@ -4,6 +4,7 @@ const saveButton = document.getElementById('save');
function validateAndSave() {
let valid = true;
//check stammTVBaseUrl
if (stammTVBaseUrl.value.startsWith('http://') || stammTVBaseUrl.value.startsWith('https://')) {
stammTVBaseUrl.classList.remove('is-invalid');
stammTVBaseUrl.classList.add('is-valid');
@ -14,6 +15,7 @@ function validateAndSave() {
valid = false;
}
//check stammTVWSSUrl
if (stammTVWSSUrl.value.startsWith('wss://')) {
stammTVWSSUrl.classList.remove('is-invalid');
stammTVWSSUrl.classList.add('is-valid');
@ -23,8 +25,10 @@ function validateAndSave() {
stammTVWSSUrl.classList.add('is-invalid');
valid = false;
}
if (valid) {
save();
init();
} else {
console.log('Failed to save settings - form validation was not successful.')
saveButton.classList.replace('btn-primary', 'btn-danger');

Loading…
Cancel
Save