added better error messages if config secret permission is missing

This commit is contained in:
dswbx
2025-01-18 13:31:33 +01:00
parent db10188945
commit fb2dff956b
9 changed files with 72 additions and 25 deletions

View File

@@ -2,6 +2,7 @@ import { IconSettings } from "@tabler/icons-react";
import { ucFirst } from "core/utils";
import { useBknd } from "ui/client/bknd";
import { Empty } from "ui/components/display/Empty";
import { Message } from "ui/components/display/Message";
import { Link } from "ui/components/wouter/Link";
import { useBrowserTitle } from "ui/hooks/use-browser-title";
import * as AppShell from "ui/layouts/AppShell/AppShell";
@@ -44,7 +45,9 @@ function SettingsSidebar() {
}
export default function SettingsRoutes() {
useBknd({ withSecrets: true });
const b = useBknd({ withSecrets: true });
if (!b.hasSecrets) return <Message.MissingPermission what="the settings" />;
return (
<>
<SettingsSidebar />