forked from mirror/pixelfed
Update privacy settings view
This commit is contained in:
parent
74b76ac175
commit
1c0b6134e3
1 changed files with 5 additions and 2 deletions
|
@ -69,12 +69,13 @@
|
||||||
swal.close();
|
swal.close();
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
let msg = 'The URL you have entered is not valid, please try again.'
|
||||||
try {
|
try {
|
||||||
let validator = new URL(val);
|
let validator = new URL(val);
|
||||||
if(!validator.hostname || validator.protocol != 'https:') {
|
if(!validator.hostname || validator.protocol != 'https:') {
|
||||||
swal.stopLoading();
|
swal.stopLoading();
|
||||||
swal.close();
|
swal.close();
|
||||||
swal('Invalid URL', 'The URL you have entered is not valid, it must start with https://', 'error');
|
swal('Invalid URL', msg, 'error');
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
axios.post(window.location.href, {
|
axios.post(window.location.href, {
|
||||||
|
@ -84,11 +85,13 @@
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal.stopLoading();
|
swal.stopLoading();
|
||||||
swal.close();
|
swal.close();
|
||||||
|
swal('Invalid URL', msg, 'error');
|
||||||
|
return;
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
swal.stopLoading();
|
swal.stopLoading();
|
||||||
swal.close();
|
swal.close();
|
||||||
swal('Invalid URL', 'The URL you have entered is not valid, it must start with https://', 'error');
|
swal('Invalid URL', msg, 'error');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue