admin: fix theme flash

This commit is contained in:
dswbx
2025-07-02 18:14:35 +02:00
parent 45138c25f0
commit 22b54862e8
4 changed files with 4 additions and 6 deletions

View File

@@ -51,7 +51,7 @@ export class AdminController extends Controller {
basepath: this._options.basepath ?? "/", basepath: this._options.basepath ?? "/",
adminBasepath: this._options.adminBasepath ?? "", adminBasepath: this._options.adminBasepath ?? "",
assetsPath: this._options.assetsPath ?? config.server.assets_path, assetsPath: this._options.assetsPath ?? config.server.assets_path,
theme: this._options.theme ?? "system", //theme: this._options.theme ?? "system",
logo_return_path: this._options.logoReturnPath ?? "/", logo_return_path: this._options.logoReturnPath ?? "/",
}; };
} }

View File

@@ -55,7 +55,7 @@ export default function Admin({
const Skeleton = ({ theme }: { theme?: any }) => { const Skeleton = ({ theme }: { theme?: any }) => {
const t = useTheme(); const t = useTheme();
const actualTheme = theme ?? t.theme; const actualTheme = theme && ["dark", "light"].includes(theme) ? theme : t.theme;
return ( return (
<div id="bknd-admin" className={actualTheme + " antialiased"}> <div id="bknd-admin" className={actualTheme + " antialiased"}>

View File

@@ -185,9 +185,7 @@ function UserMenu() {
} }
} }
if (!options.theme) { items.push(() => <UserMenuThemeToggler />);
items.push(() => <UserMenuThemeToggler />);
}
items.push(() => ( items.push(() => (
<div className="font-mono leading-none text-xs text-primary/50 text-center pb-1 pt-2 mt-1 border-t border-primary/5"> <div className="font-mono leading-none text-xs text-primary/50 text-center pb-1 pt-2 mt-1 border-t border-primary/5">
{getVersion()} {getVersion()}

View File

@@ -15,7 +15,7 @@
}, },
"app": { "app": {
"name": "bknd", "name": "bknd",
"version": "0.15.0-rc.3", "version": "0.15.0-rc.8",
"bin": "./dist/cli/index.js", "bin": "./dist/cli/index.js",
"dependencies": { "dependencies": {
"@cfworker/json-schema": "^4.1.1", "@cfworker/json-schema": "^4.1.1",