Skip to content

Commit

Permalink
Merge pull request #39301 from nextcloud/fix/legacy-navigate-param
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Jul 11, 2023
2 parents d18b65a + af144f7 commit bb66a5e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions apps/files/src/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,17 @@ const router = new Router({
},
})

router.beforeEach((to, from, next) => {
// TODO: Remove this when the legacy files list is removed
try {
const views = window.OCP.Files?.Navigation?.views || []
const isLegacy = views.find(view => view?.id === to?.params?.view)?.legacy === true
if (isLegacy && to?.query?.dir !== from?.query?.dir) {
// https://github.com/nextcloud/server/blob/1b422df12ac8eb26514849fb117e0dcf58623b88/apps/files/js/filelist.js#L2052-L2076
window.OCA.Files.App.fileList.changeDirectory(to?.query?.dir || '/', false, false, to?.query?.fileid, true)
}
} catch (error) {}
next()
})

export default router
4 changes: 2 additions & 2 deletions dist/files-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-main.js.map

Large diffs are not rendered by default.

0 comments on commit bb66a5e

Please sign in to comment.