diff --git a/app/frontend/apps/mobile/pages/home/routes.ts b/app/frontend/apps/mobile/pages/home/routes.ts index 1a064434dd03..c6d5b53bb704 100644 --- a/app/frontend/apps/mobile/pages/home/routes.ts +++ b/app/frontend/apps/mobile/pages/home/routes.ts @@ -10,12 +10,13 @@ const route: RouteRecordRaw[] = [ component: () => import('./views/Home.vue'), beforeEnter(to) { const location = to.hash && to.hash.slice(1) - if (location) { - const route = Router.resolve(location) - if (route.name !== 'Error') { - return `/${location}` - } - } + + if (!location) return true + + const route = Router.resolve(location) + const path = route.name === 'Error' ? '/' : `/${location}` + + return { path, replace: true } }, meta: { title: __('Home'), diff --git a/spec/system/apps/mobile/app_links_spec.rb b/spec/system/apps/mobile/app_links_spec.rb index 36324603bdae..572c3c28831a 100644 --- a/spec/system/apps/mobile/app_links_spec.rb +++ b/spec/system/apps/mobile/app_links_spec.rb @@ -87,7 +87,7 @@ it_behaves_like 'redirecting to mobile app', 'ticket/create', 'ticket/create', authenticated: true it_behaves_like 'redirecting to mobile app', 'ticket/zoom/1', 'ticket/zoom/1', authenticated: true it_behaves_like 'redirecting to mobile app', 'user/profile/1', 'user/profile/1', authenticated: true - it_behaves_like 'redirecting to mobile app', 'dashboard', '#dashboard', authenticated: true + it_behaves_like 'redirecting to mobile app', 'dashboard', %r{mobile/$}, authenticated: true context 'with customer user', authenticated_as: :customer do let(:customer) { create(:customer) }