Skip to content

Commit 5812336

Browse files
juliusknorrmax-nextcloud
authored andcommitted
Do not render the workspace if file list is hidden
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent b6d1ec4 commit 5812336

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/helpers/files.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
*/
2222

2323
import { loadState } from '@nextcloud/initial-state'
24+
import { subscribe } from '@nextcloud/event-bus'
2425
import { openMimetypes } from './mime.js'
2526
import { getSharingToken } from './token.js'
2627
import RichWorkspace from '../views/RichWorkspace.vue'
@@ -174,6 +175,12 @@ const FilesWorkspacePlugin = {
174175
store,
175176
}).$mount(this.el)
176177

178+
subscribe('files:navigation:changed', () => {
179+
// Expose if the default file list is active to the component
180+
// to only render the workspace if the file list is actually visible
181+
vm.active = OCA.Files.App.getCurrentFileList() === fileList
182+
})
183+
177184
fileList.$el.on('urlChanged', data => {
178185
vm.path = data.dir.toString()
179186
})

src/views/RichWorkspace.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
-->
2222

2323
<template>
24-
<div v-if="enabled" id="rich-workspace" :class="{'icon-loading': !loaded || !ready, 'focus': focus, 'dark': darkTheme, 'creatable': canCreate, 'empty': showEmptyWorkspace}">
24+
<div v-if="enabled && active" id="rich-workspace" :class="{'icon-loading': !loaded || !ready, 'focus': focus, 'dark': darkTheme, 'creatable': canCreate, 'empty': showEmptyWorkspace}">
2525
<a v-if="showEmptyWorkspace"
2626
tabindex="0"
2727
class="empty-workspace"
@@ -71,6 +71,10 @@ export default {
7171
type: String,
7272
required: true,
7373
},
74+
active: {
75+
type: Boolean,
76+
default: true,
77+
},
7478
},
7579
data() {
7680
return {

0 commit comments

Comments
 (0)