From 51f5113aff15d88e9697cf6b4640212634028c7d Mon Sep 17 00:00:00 2001 From: Tero Date: Tue, 6 Oct 2026 23:49:52 +0300 Subject: [PATCH] Ver V0.1.15 Remove initials icon from bottom left corner FIX Diplay name is supported per account --- TODO.md | 4 ++-- account-ui.js | 2 +- desktop/main.cjs | 8 +++++--- index.html | 1 - mail-ui.js | 18 ++++++++++++------ package-lock.json | 4 ++-- package.json | 2 +- productivity.js | 5 ++--- 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/TODO.md b/TODO.md index a30e24e..66bcc10 100644 --- a/TODO.md +++ b/TODO.md @@ -30,5 +30,5 @@ - [x] Add an **Edit** button for each connected mail account so its account settings can be changed after setup. - [ ] Move CalDAV and CardDAV server configuration into Account Settings, removing the server settings controls from the Calendar and Contacts views. - [x] Keep general Settings focused on appearance and other app-wide preferences rather than the display name. -- [ ] Display name must be set per account. -- [ ] Remove the display name initials from the bottom-left corner. +- [x] Display name must be set per account. +- [x] Remove the display name initials from the bottom-left corner. diff --git a/account-ui.js b/account-ui.js index c91c731..814a4d2 100644 --- a/account-ui.js +++ b/account-ui.js @@ -3,7 +3,7 @@ async function openAccountManager(){ try{ const data=await window.daybreakMail.listAccounts(); const accounts=data.accounts||[]; - const rows=accounts.map(account=>`
`).join(''); + const rows=accounts.map(account=>`
`).join(''); root.innerHTML=``; const close=()=>root.innerHTML=''; root.querySelectorAll('.modal-close').forEach(button=>button.onclick=close); diff --git a/desktop/main.cjs b/desktop/main.cjs index 87267e2..be98098 100644 --- a/desktop/main.cjs +++ b/desktop/main.cjs @@ -110,10 +110,12 @@ function normalizeAccount(input) { const password = String(input?.password || ''); const imapHost = String(input?.imapHost || '').trim(); const smtpHost = String(input?.smtpHost || '').trim(); + const displayName = String(input?.displayName || '').trim().slice(0, 80); if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) || !password || !imapHost || !smtpHost) { throw new Error('Enter a valid email, password, and both mail server names.'); } - return { email, password, imapHost, smtpHost, imapPort: 143, smtpPort: 587 }; + if (!displayName) throw new Error('Enter a display name for this mail account.'); + return { email, password, displayName, imapHost, smtpHost, imapPort: 143, smtpPort: 587 }; } function imapClient(account) { @@ -183,7 +185,7 @@ async function readAccount(accountId = null) { } function publicAccount(account) { - return { id: account.id, email: account.email, imapHost: account.imapHost, smtpHost: account.smtpHost }; + return { id: account.id, email: account.email, displayName: account.displayName || '', imapHost: account.imapHost, smtpHost: account.smtpHost }; } async function saveAccount(account) { @@ -603,7 +605,7 @@ ipcMain.handle('mail:send', async (_event, message) => { if (!to) throw new Error('Add at least one recipient.'); const transport = smtpTransport(account); const sentMessageId = `<${require('node:crypto').randomUUID()}@ep-mail.local>`; - const fromName = String(message.displayName || account.email).replace(/[\r\n]+/g, ' ').trim().slice(0, 80) || account.email; + const fromName = String(account.displayName || message.displayName || account.email).replace(/[\r\n]+/g, ' ').trim().slice(0, 80) || account.email; const messageOptions = { from: { name: fromName, address: account.email }, to, diff --git a/index.html b/index.html index d6e9bc7..2f1d21a 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,6 @@
-