fix: harden retained log streaming

This commit is contained in:
ajnart committed 2026-08-20 12:24:35 +02:00
1 parent ce61c87cd8
commit 90bf147901
11 files changed
+162 -86

No files matched your search

@@ -19,14 +19,13 @@ export const BaseWidgetError = (props: BaseWidgetErrorProps) => {
const t = useI18n();
const { data: session } = useSession();
const [errorTimestamp] = useState(Date.now);
const canViewLogs = session?.user.permissions.includes("other-view-logs") ?? false;
return (
<Stack h="100%" align="center" justify="center" gap="md" data-homarr-widget-error>
<props.icon size={40} />
<Stack gap={0}>
<Text ta="center">{translateIfNecessary(t, props.message)}</Text>
{props.showLogsLink && canViewLogs && (
{props.showLogsLink && session?.user.permissions.includes("other-view-logs") && (
<Anchor
component={Link}
href={`/manage/tools/logs?focus=${errorTimestamp}`}
@@ -11,6 +11,10 @@ vi.mock("@homarr/translation/client", () => ({
useI18n: () => (key: string) => key,
}));
vi.mock("@homarr/auth/client", () => ({
useSession: () => ({ data: null }),
}));
const matchMedia = (query: string) => ({
matches: false,
media: query,