Canonicalize workbench theme storage

This commit is contained in:
elpresidank 2026-06-02 08:03:43 -05:00
parent 5c4948cc2e
commit c5e7708911
4 changed files with 99 additions and 35 deletions

View file

@ -82,7 +82,16 @@
<script>
// Restore theme preference before first paint
(function() {
var theme = localStorage.getItem('tg-theme');
var rawTheme = localStorage.getItem('trustgraph-workbench-theme-v1');
var theme = null;
if (rawTheme === '"light"') {
theme = 'light';
} else if (rawTheme === '"dark"') {
theme = 'dark';
}
if (theme !== 'dark' && theme !== 'light') {
theme = localStorage.getItem('tg-theme');
}
if (theme === 'light') {
document.body.classList.remove('dark');
document.body.classList.add('light');