Automatically fix problems with API URL

This commit is contained in:
Skylar Ittner 2018-01-23 16:34:08 -07:00
parent 78c0de345b
commit 20271883db

View File

@ -5,6 +5,12 @@
*/
function dlGroups() {
if (!$("#url").val().startsWith("http")) {
$("#url").val("https://" + $("#url").val());
}
if (!$("#url").val().endsWith("/api.php")) {
$("#url").val($("#url").val() + "/api.php");
}
localStorage.setItem("apiurl", $("#url").val());
localStorage.setItem("apikey", $("#key").val());
reloadSettings();