diff --git a/ui/src/components/cliproxy/provider-editor.tsx b/ui/src/components/cliproxy/provider-editor.tsx index d69eb1ae..98b2f5bf 100644 --- a/ui/src/components/cliproxy/provider-editor.tsx +++ b/ui/src/components/cliproxy/provider-editor.tsx @@ -566,7 +566,7 @@ export function ProviderEditor({

{displayName}

- {data && ( + {data?.path && ( {data.path.replace(/^.*\//, '')} diff --git a/ui/src/components/profile-editor.tsx b/ui/src/components/profile-editor.tsx index 8808ee00..5a763587 100644 --- a/ui/src/components/profile-editor.tsx +++ b/ui/src/components/profile-editor.tsx @@ -46,9 +46,15 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) { const queryClient = useQueryClient(); // Fetch settings for selected profile - const { data, isLoading, refetch } = useQuery({ + const { data, isLoading, isError, refetch } = useQuery({ queryKey: ['settings', profileName], - queryFn: () => fetch(`/api/settings/${profileName}/raw`).then((r) => r.json()), + queryFn: async () => { + const res = await fetch(`/api/settings/${profileName}/raw`); + if (!res.ok) { + throw new Error(`Failed to load settings: ${res.status}`); + } + return res.json(); + }, }); // Derive raw JSON content @@ -427,7 +433,7 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) {

{profileName}

- {data && ( + {data?.path && ( {data.path.replace(/^.*\//, '')} @@ -473,6 +479,18 @@ export function ProfileEditor({ profileName, onDelete }: ProfileEditorProps) { Loading settings...
+ ) : isError ? ( +
+
+

+ Failed to load settings for this profile. +

+ +
+
) : ( // Split Layout (40% Left / 60% Right)