diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2023-07-11 09:46:41 +0200 |
---|---|---|
committer | nextcloud-command <nextcloud-command@users.noreply.github.com> | 2023-07-11 12:01:51 +0000 |
commit | af144f7bc321ea84ee6338b94abca775b1ba26cc (patch) | |
tree | 52cce123e83fad74ac1816845655727bc0bab59f /apps | |
parent | b43e45d3c2dabd573a5a519ea96b6a33f38fe759 (diff) | |
download | nextcloud-server-af144f7bc321ea84ee6338b94abca775b1ba26cc.tar.gz nextcloud-server-af144f7bc321ea84ee6338b94abca775b1ba26cc.zip |
fix(files): fix legacy router query change
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/src/router/router.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files/src/router/router.js b/apps/files/src/router/router.js index 0d833cd6464..9ddef545553 100644 --- a/apps/files/src/router/router.js +++ b/apps/files/src/router/router.js @@ -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 |