vor ähnlichkeitsprüfung

This commit is contained in:
2025-12-21 14:21:55 +01:00
parent ffcfce2b31
commit fde5ab91c8
14 changed files with 721 additions and 50 deletions

View File

@@ -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();
}
})();