diff --git a/apps/builder/app/canvas/interceptor.ts b/apps/builder/app/canvas/interceptor.ts index b78655df2d4a..bb3f8a49fefe 100644 --- a/apps/builder/app/canvas/interceptor.ts +++ b/apps/builder/app/canvas/interceptor.ts @@ -24,13 +24,14 @@ const isAbsoluteUrl = (href: string) => { }; const getSelectedPagePathname = () => { + const pages = $pages.get(); const page = $selectedPage.get(); const dataSourceVariables = $dataSourceVariables.get(); - if (page) { + if (page && pages) { const system = dataSourceVariables.get(page.systemDataSourceId) as | undefined | System; - const tokens = tokenizePathnamePattern(page.path); + const tokens = tokenizePathnamePattern(getPagePath(page.id, pages)); return compilePathnamePattern(tokens, system?.params ?? {}); } };