Skip to content

Commit 9c45051

Browse files
author
henrychoy
committed
feat: handle going from job back to experiment
1 parent b13db4c commit 9c45051

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/frontend/src/router/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ const router = createRouter({
110110
},
111111
{
112112
path: '/jobs/:id',
113-
component: () => import('../views/JobDashboardView.vue')
113+
component: () => import('../views/JobDashboardView.vue'),
114+
name: 'jobDashboard'
114115
},
115116
]
116117
},
@@ -180,7 +181,8 @@ router.beforeEach(async (to, from) => {
180181

181182
const backButton = window.event?.type === 'popstate'
182183
const backToSameType = to.meta?.type === from.meta?.type
183-
if(backButton && backToSameType) {
184+
const jobBackToExperiment = to.name === 'experimentJobs' && from.name === 'jobDashboard'
185+
if(backButton && (backToSameType || jobBackToExperiment)) {
184186
to.meta.backButton = true
185187
}
186188

0 commit comments

Comments
 (0)