vor ähnlichkeitsprüfung
This commit is contained in:
@@ -9,6 +9,19 @@
|
||||
const DEFAULT_BULK_COUNT = 5;
|
||||
const DEFAULT_SORT = { column: 'last_completed_at', direction: 'desc' };
|
||||
const AUTO_OPEN_DELAY_MS = 1500;
|
||||
const LOGIN_PAGE = 'login.html';
|
||||
|
||||
function handleUnauthorized(response) {
|
||||
if (response && response.status === 401) {
|
||||
if (typeof redirectToLogin === 'function') {
|
||||
redirectToLogin();
|
||||
} else {
|
||||
window.location.href = LOGIN_PAGE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const state = {
|
||||
dayKey: formatDayKey(new Date()),
|
||||
@@ -436,6 +449,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
if (handleUnauthorized(response)) {
|
||||
throw new Error('Nicht angemeldet');
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
const message = `Fehler: HTTP ${response.status}`;
|
||||
throw new Error(message);
|
||||
@@ -1479,4 +1496,9 @@
|
||||
activate,
|
||||
deactivate: cleanup
|
||||
};
|
||||
|
||||
const dailySection = document.querySelector('[data-view="daily-bookmarks"]');
|
||||
if (dailySection && dailySection.classList.contains('app-view--active')) {
|
||||
activate();
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user