Ensure in-app navigation via navigate to action automatically prefixes URLs with slashes

This commit is contained in:
Andrew Kingston 2024-05-22 09:35:27 +01:00
parent c726dfbedb
commit c89a7a261f
1 changed files with 7 additions and 1 deletions

View File

@ -238,7 +238,13 @@ const triggerAutomationHandler = async action => {
} }
} }
const navigationHandler = action => { const navigationHandler = action => {
const { url, peek, externalNewTab } = action.parameters let { url, peek, externalNewTab, type } = action.parameters
// Ensure in-app navigation starts with a slash
if (type === "screen" && url && !url.startsWith("/")) {
url = `/${url}`
}
routeStore.actions.navigate(url, peek, externalNewTab) routeStore.actions.navigate(url, peek, externalNewTab)
closeSidePanelHandler() closeSidePanelHandler()
} }