Patch 1.5.3, Fixes theme sync issue on first startup
Addresses a bug where the email viewer's dark mode setting was not correctly synchronized with the selected theme on the first application launch. This ensures a consistent user experience regarding light/dark mode across the application and email viewer.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
[EMLy]
|
[EMLy]
|
||||||
SDK_DECODER_SEMVER = 1.3.2
|
SDK_DECODER_SEMVER = 1.3.2
|
||||||
SDK_DECODER_RELEASE_CHANNEL = stable
|
SDK_DECODER_RELEASE_CHANNEL = stable
|
||||||
GUI_SEMVER = 1.5.2
|
GUI_SEMVER = 1.5.3
|
||||||
GUI_RELEASE_CHANNEL = beta
|
GUI_RELEASE_CHANNEL = beta
|
||||||
LANGUAGE = it
|
LANGUAGE = it
|
||||||
UPDATE_CHECK_ENABLED = false
|
UPDATE_CHECK_ENABLED = false
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
try {
|
try {
|
||||||
const key = "emly_theme";
|
const key = "emly_theme";
|
||||||
const stored = localStorage.getItem(key);
|
const stored = localStorage.getItem(key);
|
||||||
const theme = stored === "light" || stored === "dark" ? stored : "light";
|
const theme = stored === "light" || stored === "dark" ? stored : "dark";
|
||||||
document.documentElement.classList.toggle("dark", theme === "dark");
|
document.documentElement.classList.toggle("dark", theme === "dark");
|
||||||
} catch {
|
} catch {
|
||||||
// If storage is blocked, default to light.
|
// If storage is blocked, default to light.
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ class SettingsStore {
|
|||||||
this.settings.theme = storedTheme;
|
this.settings.theme = storedTheme;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sync useDarkEmailViewer with theme
|
||||||
|
this.settings.useDarkEmailViewer = this.settings.theme === "dark";
|
||||||
|
|
||||||
// Apply the theme
|
// Apply the theme
|
||||||
applyTheme(this.settings.theme);
|
applyTheme(this.settings.theme);
|
||||||
|
|
||||||
|
|||||||
@@ -211,6 +211,16 @@
|
|||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sync theme with email viewer dark mode
|
||||||
|
let previousTheme = $state<string | undefined>(undefined);
|
||||||
|
$effect(() => {
|
||||||
|
if (!browser) return;
|
||||||
|
if (previousTheme !== undefined && form.theme !== previousTheme) {
|
||||||
|
form.useDarkEmailViewer = form.theme === "dark";
|
||||||
|
}
|
||||||
|
previousTheme = form.theme;
|
||||||
|
});
|
||||||
|
|
||||||
async function exportSettings() {
|
async function exportSettings() {
|
||||||
try {
|
try {
|
||||||
const settingsJSON = JSON.stringify(form, null, 2);
|
const settingsJSON = JSON.stringify(form, null, 2);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#define ApplicationName 'EMLy'
|
#define ApplicationName 'EMLy'
|
||||||
#define ApplicationVersion GetVersionNumbersString('EMLy.exe')
|
#define ApplicationVersion GetVersionNumbersString('EMLy.exe')
|
||||||
#define ApplicationVersion '1.5.2'
|
#define ApplicationVersion '1.5.3_beta'
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|||||||
Reference in New Issue
Block a user