new features

This commit is contained in:
Matthias Hochmeister
2026-03-23 18:08:49 +01:00
parent e720c52896
commit 202a658b8d
4 changed files with 28 additions and 11 deletions

View File

@@ -79,7 +79,9 @@ const BookStackRecentWidget: React.FC = () => {
const configured = data?.configured ?? false;
const pages = (data?.data ?? []).slice(0, 5);
if (!configured) {
// Only show "nicht eingerichtet" when we got a successful response with configured=false
// (not when the request errored out with 403 etc.)
if (data && !configured) {
return (
<Card sx={{ height: '100%' }}>
<CardContent>

View File

@@ -75,7 +75,7 @@ const BookStackSearchWidget: React.FC = () => {
return () => { isMountedRef.current = false; };
}, []);
const { data, isLoading: configLoading } = useQuery({
const { data, isLoading: configLoading, isError: configError } = useQuery({
queryKey: ['bookstack-recent'],
queryFn: () => bookstackApi.getRecent(),
refetchInterval: 5 * 60 * 1000,
@@ -83,7 +83,8 @@ const BookStackSearchWidget: React.FC = () => {
});
// undefined while loading, true/false once known
const configured = configLoading ? undefined : (data?.configured ?? false);
// On error (e.g. 403), treat as configured to avoid "nicht eingerichtet" message
const configured = configLoading ? undefined : configError ? true : (data?.configured ?? false);
useEffect(() => {
if (debounceRef.current) clearTimeout(debounceRef.current);