From fba1857e1b7180c9dfb9692884f9190ea1643829 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Tue, 24 Mar 2026 17:39:15 +0400 Subject: [PATCH] fixed navbutton fallback --- frontend/next-env.d.ts | 2 +- frontend/src/pages/constructor.tsx | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/frontend/next-env.d.ts b/frontend/next-env.d.ts index 254b73c..00a8785 100644 --- a/frontend/next-env.d.ts +++ b/frontend/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -/// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/frontend/src/pages/constructor.tsx b/frontend/src/pages/constructor.tsx index e52ddce..19212e9 100644 --- a/frontend/src/pages/constructor.tsx +++ b/frontend/src/pages/constructor.tsx @@ -2008,23 +2008,11 @@ const ConstructorPage = ({ mode = 'constructor' }: ConstructorPageProps) => { element.navType === 'back' || element.type === 'navigation_prev' ? 'back' : 'forward'; - const configuredTargetId = String(element.targetPageId || '').trim(); - const fallbackTargetId = (() => { - const currentPageIndex = pages.findIndex( - (page) => page.id === activePageId, - ); - if (currentPageIndex < 0) return ''; - - const nextPageIndex = - direction === 'back' ? currentPageIndex - 1 : currentPageIndex + 1; - const nextPage = pages[nextPageIndex]; - return nextPage ? String(nextPage.id || '').trim() : ''; - })(); - const targetPageId = configuredTargetId || fallbackTargetId; + const targetPageId = String(element.targetPageId || '').trim(); if (!targetPageId) { setErrorMessage( - 'No target page available for this navigation button.', + 'No target page configured for this navigation button.', ); return; }