diff --git a/client/src/pages/widget-editor/model/useWidgetEditor.ts b/client/src/pages/widget-editor/model/useWidgetEditor.ts
index e0e4cf1..8a74bf3 100644
--- a/client/src/pages/widget-editor/model/useWidgetEditor.ts
+++ b/client/src/pages/widget-editor/model/useWidgetEditor.ts
@@ -54,6 +54,7 @@ export const useWidgetEditor = ({
const [isSaving, setSaving] = useState(false);
const [isDirty, setDirty] = useState(false);
const [error, setError] = useState
(null);
+ const [loadStatus, setLoadStatus] = useState(null);
const widgetRef = useRef(null);
const savePromiseRef = useRef | null>(null);
const editVersionRef = useRef(0);
@@ -84,7 +85,10 @@ export const useWidgetEditor = ({
setDirty(nextIsDirty);
})
.catch((loadError) => {
- if (!cancelled) setError(errorMessage(loadError, messages.unavailable));
+ if (cancelled) return;
+ setError(errorMessage(loadError, messages.unavailable));
+ const status = (loadError as { status?: unknown } | null)?.status;
+ setLoadStatus(typeof status === 'number' ? status : 500);
})
.finally(() => {
if (!cancelled) setLoading(false);
@@ -246,6 +250,7 @@ export const useWidgetEditor = ({
setActivePanel,
selectBlock,
isLoading,
+ loadStatus,
isSaving,
isDirty,
isDirtyRef,
diff --git a/client/src/pages/widget-editor/ui/WidgetEditorPage.tsx b/client/src/pages/widget-editor/ui/WidgetEditorPage.tsx
index b4f66cf..6cac726 100644
--- a/client/src/pages/widget-editor/ui/WidgetEditorPage.tsx
+++ b/client/src/pages/widget-editor/ui/WidgetEditorPage.tsx
@@ -12,6 +12,7 @@ import { EditorCanvas } from '@/pages/widget-editor/ui/EditorCanvas';
import { EditorHeader } from '@/pages/widget-editor/ui/EditorHeader';
import { MobileFallback } from '@/pages/widget-editor/ui/MobileFallback';
import { WidgetConfigPanel } from '@/pages/widget-editor/ui/WidgetConfigPanel';
+import { ErrorPage } from '@/widgets/error-page';
import { messages, type Locale } from '@/shared/locale/content';
import { AuthTransitionLoader } from '@/shared/ui/auth-transition-loader/AuthTransitionLoader';
import styles from '@/pages/widget-editor/ui/WidgetEditorPage.module.css';
@@ -24,6 +25,7 @@ type WidgetEditorPageProps = {
onBack: () => void;
onOpenPublic: (slug: string) => void;
onSave?: (widget: Widget) => void;
+ onHome: () => void;
};
const useIsMobile = () => {
@@ -44,6 +46,7 @@ export const WidgetEditorPage = ({
onBack,
onOpenPublic,
onSave,
+ onHome,
}: WidgetEditorPageProps) => {
const t = messages[locale];
const prefersReducedMotion = useReducedMotion();
@@ -75,10 +78,16 @@ export const WidgetEditorPage = ({
);
if (!widget)
- return (
-