From ffda3db9e460e1e11dda784e41fcea198d5ec47f Mon Sep 17 00:00:00 2001 From: "Grigorii K. Shartsev" Date: Tue, 31 Oct 2023 00:21:56 +0100 Subject: fix(files): add silent mode in legacy navigation Signed-off-by: Grigorii K. Shartsev --- apps/files/src/views/Navigation.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apps/files/src') diff --git a/apps/files/src/views/Navigation.vue b/apps/files/src/views/Navigation.vue index e164880003a..d4dbb7899aa 100644 --- a/apps/files/src/views/Navigation.vue +++ b/apps/files/src/views/Navigation.vue @@ -228,16 +228,20 @@ export default { * Coming from the legacy files app. * TODO: remove when all views are migrated. * - * @param {Navigation} view the new active view + * @param {object} payload the payload + * @param {string} [payload.id='files'] the view id + * @param {boolean} [payload.silent=false] if true, the view will not be shown immediately */ - onLegacyNavigationChanged({ id } = { id: 'files' }) { + onLegacyNavigationChanged({ id = 'files', silent = false } = {}) { const view = this.Navigation.views.find(view => view.id === id) if (view && view.legacy && view.id !== this.currentView.id) { // Force update the current route as the request comes // from the legacy files app router this.$router.replace({ ...this.$route, params: { view: view.id } }) - this.Navigation.setActive(view) - this.showView(view) + if (!silent) { + this.Navigation.setActive(view) + this.showView(view) + } } }, -- cgit v1.2.3