Merge pull request #42382 from nextcloud/feature/filelist_refresh_current_folder_on_update

This commit is contained in:
John Molakvoæ 2024-01-11 16:19:47 +01:00 committed by GitHub
commit 10b9b20da5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View file

@ -122,7 +122,7 @@ import type { Upload } from '@nextcloud/upload'
import type { UserConfig } from '../types.ts'
import type { View, ContentsWithRoot } from '@nextcloud/files'
import { emit } from '@nextcloud/event-bus'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import { Folder, Node, Permission } from '@nextcloud/files'
import { getCapabilities } from '@nextcloud/capabilities'
import { join, dirname } from 'path'
@ -436,6 +436,11 @@ export default defineComponent({
mounted() {
this.fetchContent()
subscribe('files:node:updated', this.onUpdatedNode)
},
unmounted() {
unsubscribe('files:node:updated', this.onUpdatedNode)
},
methods: {
@ -556,6 +561,17 @@ export default defineComponent({
showError(this.t('files', 'Unknown error during upload'))
},
/**
* Refreshes the current folder on update.
*
* @param {Node} node is the file/folder being updated.
*/
onUpdatedNode(node) {
if (node?.fileid === this.currentFolder?.fileid) {
this.fetchContent()
}
},
openSharingSidebar() {
if (window?.OCA?.Files?.Sidebar?.setActiveTab) {
window.OCA.Files.Sidebar.setActiveTab('sharing')

4
dist/files-main.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long