1 parent
dacdf9c27d
commit
a116890e20
34 files changed
+186
-83
No files matched your search
@@ -315,7 +315,7 @@ async function loadMailPreferences() {
|
||||
try {
|
||||
const prefs = await request("/settings/mailbox", { method: "GET" });
|
||||
state.mailPrefs = { ...state.mailPrefs, ...prefs };
|
||||
state.perPage = Number(state.mailPrefs.messages_per_page || 50);
|
||||
state.perPage = Number(state.mailPrefs.messages_per_page || 300);
|
||||
const values = {
|
||||
"#mail-pref-per-page": String(state.perPage),
|
||||
"#mail-pref-read-delay": String(state.mailPrefs.mark_read_delay_ms || 0),
|
||||
@@ -353,7 +353,7 @@ async function saveMailPreferences() {
|
||||
};
|
||||
try {
|
||||
state.mailPrefs = await request("/settings/mailbox", { method: "PUT", body: JSON.stringify(payload) });
|
||||
state.perPage = Number(state.mailPrefs.messages_per_page || 50);
|
||||
state.perPage = Number(state.mailPrefs.messages_per_page || 300);
|
||||
toast("Mailbox settings saved");
|
||||
if (state.currentDetail) renderMessageDetail(state.currentDetail);
|
||||
await loadMessages(true);
|
||||
@@ -458,6 +458,17 @@ function showApp() {
|
||||
$("#app-view").classList.remove("hidden");
|
||||
}
|
||||
|
||||
function finishAuthenticatedStartup() {
|
||||
state.startupToastsMuted = false;
|
||||
armRealtimeNotifications();
|
||||
toast(tr("login_success", "Successfully logged in"), "success");
|
||||
}
|
||||
|
||||
function prepareAuthenticatedStartup() {
|
||||
state.startupToastsMuted = true;
|
||||
resetRealtimeNotificationGate();
|
||||
}
|
||||
|
||||
function settingsTabAvailable(name) {
|
||||
if (name === "openpgp") return state.authPolicy.pgpEnabled !== false;
|
||||
if (name === "sieve") return state.authPolicy.sieveEnabled !== false;
|
||||
@@ -697,6 +708,7 @@ async function login(event) {
|
||||
const errorBox = $("#login-error");
|
||||
errorBox.classList.add("hidden");
|
||||
setBusy(submit, true);
|
||||
prepareAuthenticatedStartup();
|
||||
try {
|
||||
const data = await request("/auth/login", {
|
||||
method: "POST",
|
||||
@@ -723,6 +735,7 @@ async function login(event) {
|
||||
await loadTrustedSenders();
|
||||
startCalendarReminderWatcher();
|
||||
connectRealtime();
|
||||
finishAuthenticatedStartup();
|
||||
} catch (error) {
|
||||
errorBox.textContent = error.message;
|
||||
errorBox.classList.remove("hidden");
|
||||
@@ -733,6 +746,7 @@ async function login(event) {
|
||||
|
||||
async function logout() {
|
||||
disconnectRealtime();
|
||||
prepareAuthenticatedStartup();
|
||||
if (state.calendarReminderTimer) { clearInterval(state.calendarReminderTimer); state.calendarReminderTimer = null; }
|
||||
try { await request("/auth/logout", { method: "POST", body: "{}" }); } catch (_) { }
|
||||
state.accountId = null;
|
||||
|
||||
Reference in new issue
Block a user