mirror of
https://github.com/Casvt/MIND.git
synced 2026-02-19 11:54:46 -05:00
Fixes issue #47
This commit is contained in:
@@ -52,7 +52,7 @@ function addReminder() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e === 400) {
|
||||
inputs.time.classList.add('error-input');
|
||||
inputs.time.title = 'Time is in the past';
|
||||
@@ -158,7 +158,7 @@ function testReminder() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ function editReminder() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -99,7 +99,7 @@ function showEdit(id) {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e === 404) {
|
||||
fillList();
|
||||
} else {
|
||||
@@ -142,7 +142,7 @@ function deleteReminder() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e === 404) {
|
||||
fillList();
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ function logout() {
|
||||
})
|
||||
.then(response => {
|
||||
sessionStorage.removeItem('api_key');
|
||||
window.location.href = url_prefix || '/';
|
||||
window.location.href = `${url_prefix}/`;
|
||||
});
|
||||
};
|
||||
|
||||
@@ -52,7 +52,7 @@ function showTab(tab_id, button_id, load_function=null) {
|
||||
const url_prefix = document.getElementById('url_prefix').dataset.value;
|
||||
const api_key = sessionStorage.getItem('api_key');
|
||||
if (api_key === null) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
};
|
||||
|
||||
document.getElementById('toggle-nav').addEventListener('click', e => toggleNav());
|
||||
|
||||
@@ -87,7 +87,7 @@ function fillNotificationSelection() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -113,7 +113,7 @@ function deleteService(id) {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e.error === 'ApiKeyExpired' || e.error === 'ApiKeyInvalid') {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e.error === 'NotificationServiceInUse') {
|
||||
const delete_button = row.querySelector('button[title="Delete"]');
|
||||
delete_button.classList.add('error-icon');
|
||||
@@ -151,7 +151,7 @@ function saveService(id) {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e === 400) {
|
||||
save_button.classList.add('error-icon');
|
||||
save_button.title = 'Invalid Apprise URL';
|
||||
@@ -199,7 +199,7 @@ function addService() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else if (e === 400) {
|
||||
inputs_buttons.save_button.classList.add('error-icon');
|
||||
inputs_buttons.save_button.title = 'Invalid Apprise URL';
|
||||
|
||||
@@ -55,7 +55,7 @@ function fillList() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -77,7 +77,7 @@ function search() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ function changePassword() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -28,7 +28,7 @@ function deleteAccount() {
|
||||
'method': 'DELETE'
|
||||
})
|
||||
.then(response => {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ function loadTemplates(force=true) {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -99,7 +99,7 @@ function loadTemplate() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -134,7 +134,7 @@ function addTemplate() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -177,7 +177,7 @@ function showEditTemplate(id) {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -210,7 +210,7 @@ function saveTemplate() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
@@ -233,7 +233,7 @@ function deleteTemplate() {
|
||||
})
|
||||
.catch(e => {
|
||||
if (e === 401) {
|
||||
window.location.href = url_prefix;
|
||||
window.location.href = `${url_prefix}/`;
|
||||
} else {
|
||||
console.log(e);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user