Open Biosias opened 1 year ago
I managed to reproduce this, so I tried to follow the trail of events to understand what's going on. The source of the problem seems to be an invalid state of preferences.json
. We are storing information about custom themes in there, but we are also using local storage to persist the theme. In various cases, the theme is not properly persisted on preferences.json
(installing a third theme might be required to reach this state). When we reload the app, activateUserPreferences
is called and loads the prefs from the json , then selectTheme
which emits theme-selected
that resets the local storage theme mode (state/set-theme-mode!
) to an invalid value.
I have the same problem on Windows 10, but not on Linux (Mint)
I have the same problem
App Version: 0.9.20 Git Revision: 43c8e1c Platform: Mozilla/5.0 (Windows NT 10.0 Win64 x64) AppleWebKit/537.36 (KHTML like Gecko) Logseq/0.9.20 Chrome/114.0.5735.289 Electron/25.9.3 Safari/537.36 Language: en-US Plugins:
If I delete my $HOME/.logseq/preferences.json
and then open and close Logseq it generates this:
{
"theme": null,
"themes": {
"mode": "light",
"light": null,
"dark": null
},
"externals": []
}
If I open it and then switch the from light to system to dark and then close Logseq then it saves this, and then when it reopens it is in light mode:
{
"theme": null,
"themes": {
"mode": "light",
"light": {
"name": "Default Light Theme",
"url": null,
"description": "Logseq default light theme.",
"mode": "light",
"selected": true,
"group-first": true,
"group-desc": "light themes"
},
"dark": null
},
"externals": []
}
I'm having exactly this issue.
Distributor ID: Ubuntu Description: Ubuntu 22.04.4 LTS Release: 22.04 Codename: jammy
Anything I can do to help diagnose the problem?
The workaround I found, at least on macOS, is to choose System Theme within Logseq, and then at the OS level to choose Dark theme.
Search first
What Happened?
When Dark mode is enabled and then the app is closed and reopened it opens with Dark mode disabled. I tested that this happens on Default theme and also "Bonofix Theme" so the problem isn't only on the Default theme.
Reproduce the Bug
Expected Behavior
When Dark mode is enabled it should persist app closure
Screenshots
No response
Desktop or Mobile Platform Information
Linux Fedora 38 KDE Desktop Wayland Session
Tested that this happens on following versions:
LogSeq 0.9.17 Flatpak version LogSeq 0.9.17 Flatpak version
Additional Context
No response
Are you willing to submit a PR? If you know how to fix the bug.