Theseus: Proton Mail in the sidebar
Proton Mail joins the default web apps on the left strip, with its own icon. A saved strip never picked up new defaults, so a web app added to the defaults later is put on existing strips once; one the user removes stays removed (quickLinksOffered).
This commit is contained in:
parent
3861925811
commit
dbf2b95c80
2 changed files with 20 additions and 0 deletions
18
main.js
18
main.js
|
|
@ -589,6 +589,7 @@ const SETTINGS_DEFAULTS = {
|
|||
{ id: "whatsapp", url: "https://web.whatsapp.com/", title: "WhatsApp" },
|
||||
{ id: "x", url: "https://x.com/", title: "X" },
|
||||
{ id: "youtube", url: "https://www.youtube.com/", title: "YouTube" },
|
||||
{ id: "proton", url: "https://mail.proton.me/", title: "Proton Mail" },
|
||||
],
|
||||
// Settings › Sidebar. Per-app panel widths and pins (keys "q:<link id>" /
|
||||
// "p:<panelId>"), extension panels the user took off the strip, and when
|
||||
|
|
@ -665,6 +666,23 @@ function loadSettings() {
|
|||
settings.quickLinks = SETTINGS_DEFAULTS.quickLinks.map((L) => ({ ...L }));
|
||||
}
|
||||
} catch (e) { console.warn("quickLinks migrate:", e?.message); }
|
||||
// A web app added to the default sidebar after a profile was made is put on
|
||||
// that profile's strip once (the saved list never picks up new defaults by
|
||||
// itself). quickLinksOffered remembers it, so one the user removes stays
|
||||
// removed. Kept out of SETTINGS_DEFAULTS so an old profile reads as "never offered".
|
||||
try {
|
||||
const LATER_DEFAULTS = ["proton"]; // added in 0.3.88
|
||||
const offered = Array.isArray(settings.quickLinksOffered) ? settings.quickLinksOffered.slice() : [];
|
||||
const have = Array.isArray(settings.quickLinks) ? settings.quickLinks : null;
|
||||
let changed = false;
|
||||
for (const id of LATER_DEFAULTS) {
|
||||
if (offered.includes(id)) continue;
|
||||
offered.push(id); changed = true;
|
||||
const def = SETTINGS_DEFAULTS.quickLinks.find((L) => L.id === id);
|
||||
if (have && def && !have.some((L) => L && L.id === id)) have.push({ ...def });
|
||||
}
|
||||
if (changed) { settings.quickLinksOffered = offered; saveSettings(); }
|
||||
} catch (e) { console.warn("quickLinks offer:", e?.message); }
|
||||
// Translator moved from a single `translateEndpoint` to a peer list in
|
||||
// the same release that shipped the chip. A custom endpoint comes along
|
||||
// as the primary peer; the historical LibreTranslate.com default is
|
||||
|
|
|
|||
|
|
@ -72,6 +72,8 @@
|
|||
whatsapp: '<svg viewBox="0 0 24 24" fill="#25D366"><path d="M19.11 4.86A9.78 9.78 0 0 0 12.04 2 9.86 9.86 0 0 0 3.6 16.84L2.05 22l5.3-1.39A9.84 9.84 0 0 0 12.04 22h.01a9.86 9.86 0 0 0 9.85-9.86 9.78 9.78 0 0 0-2.79-7.28zM12.05 20.3h-.01a8.17 8.17 0 0 1-4.16-1.14l-.3-.18-3.14.82.84-3.06-.2-.32a8.2 8.2 0 1 1 15.19-4.3 8.2 8.2 0 0 1-8.22 8.18zm4.49-6.14c-.25-.12-1.46-.72-1.69-.8-.23-.09-.4-.12-.56.12-.17.25-.65.8-.8.97-.14.17-.29.19-.54.06-.25-.12-1.05-.39-2-1.23a7.5 7.5 0 0 1-1.38-1.72c-.14-.25-.02-.38.11-.5.11-.11.25-.29.37-.43.12-.14.17-.25.25-.42.08-.17.04-.31-.02-.43-.06-.12-.56-1.35-.77-1.85-.2-.49-.4-.42-.56-.43l-.47-.01c-.17 0-.43.06-.65.31-.22.25-.86.84-.86 2.05 0 1.21.88 2.38 1 2.55.12.17 1.74 2.65 4.21 3.72.59.25 1.05.4 1.41.52.59.19 1.13.16 1.56.1.47-.07 1.46-.6 1.66-1.18.21-.57.21-1.07.14-1.17-.06-.1-.23-.17-.48-.3z"/></svg>',
|
||||
messenger: '<svg viewBox="0 0 24 24"><defs><linearGradient id="mg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#00B2FF"/><stop offset="1" stop-color="#006AFF"/></linearGradient></defs><path fill="url(#mg)" d="M12 2C6.48 2 2 6.14 2 11.26c0 2.77 1.3 5.24 3.37 6.95V22l3.08-1.69c.82.23 1.69.35 2.55.35 5.52 0 10-4.14 10-9.4C22 6.14 17.52 2 12 2zm1 12.63-2.56-2.72-4.99 2.72 5.49-5.84 2.62 2.72 4.93-2.72-5.49 5.84z"/></svg>',
|
||||
youtube: '<svg viewBox="0 0 24 24" fill="#FF0000"><path d="M23.5 6.5a3 3 0 0 0-2.1-2.12C19.46 4 12 4 12 4s-7.46 0-9.4.38A3 3 0 0 0 .5 6.5 31.3 31.3 0 0 0 .11 12a31.3 31.3 0 0 0 .4 5.5 3 3 0 0 0 2.1 2.12C4.54 20 12 20 12 20s7.46 0 9.4-.38a3 3 0 0 0 2.1-2.12A31.3 31.3 0 0 0 23.9 12a31.3 31.3 0 0 0-.4-5.5zM9.75 15.57V8.43L15.82 12l-6.07 3.57z"/></svg>',
|
||||
// Proton Mail: an envelope in Proton's purple.
|
||||
proton: '<svg viewBox="0 0 24 24" fill="none"><rect x="2" y="5" width="20" height="14" rx="3" fill="#6D4AFF"/><path d="M3.5 7.5 12 13.2l8.5-5.7" stroke="#fff" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>',
|
||||
spotify: '<svg viewBox="0 0 24 24" fill="#1DB954"><path d="M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm5.5 17.3a.75.75 0 0 1-1.03.25c-2.82-1.72-6.37-2.11-10.56-1.15a.75.75 0 1 1-.34-1.46c4.58-1.05 8.5-.6 11.68 1.33a.75.75 0 0 1 .25 1.03zm1.47-3.26a.94.94 0 0 1-1.29.3c-3.23-1.98-8.14-2.56-11.95-1.4a.94.94 0 1 1-.55-1.8c4.36-1.33 9.78-.68 13.5 1.6a.94.94 0 0 1 .3 1.3zm.13-3.4C15.26 8.4 8.72 8.2 5.1 9.34a1.12 1.12 0 1 1-.66-2.15c4.16-1.27 11.37-1.02 15.86 1.65a1.12 1.12 0 1 1-1.14 1.93z"/></svg>',
|
||||
discord: '<svg viewBox="0 0 24 24" fill="#5865F2"><path d="M20.3 4.5A17.6 17.6 0 0 0 15.9 3l-.2.4a16.2 16.2 0 0 1 3.7 1.2 20 20 0 0 0-5.6-1 18.4 18.4 0 0 0-5.7 1A16.2 16.2 0 0 1 11.8 3.4L11.6 3a17.6 17.6 0 0 0-4.4 1.5A20.2 20.2 0 0 0 3.2 15.5a16.4 16.4 0 0 0 5 2.5l.6-1a11.3 11.3 0 0 1-2.9-1.4l.5-.3c3 1.5 9.1 1.5 12 0l.5.3c-.9.5-1.9 1-2.9 1.4l.6 1a16.4 16.4 0 0 0 5-2.5A20.2 20.2 0 0 0 20.3 4.5zM9 13c-1 0-1.8-1-1.8-2.2S8 8.6 9 8.6c1 0 1.8 1 1.8 2.2S10 13 9 13zm6 0c-1 0-1.8-1-1.8-2.2S14 8.6 15 8.6c1 0 1.8 1 1.8 2.2S16 13 15 13z"/></svg>',
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue