@@ -10,6 +10,9 @@ import { isPublicShare } from '@nextcloud/sharing/public'
1010import axios from '@nextcloud/axios'
1111import { emit } from '@nextcloud/event-bus'
1212import { getCurrentDirectory } from '../helpers/filesApp.js'
13+ import {
14+ getSidebar
15+ } from '@nextcloud/files'
1316import {
1417 getClient ,
1518 getDefaultPropfind ,
@@ -106,7 +109,7 @@ export default {
106109
107110 this . changeFilesRoute ( node . fileid )
108111
109- OCA ?. Files ?. Sidebar ?. close ( )
112+ getSidebar ( ) ?. close ( )
110113
111114 if ( this . getFileList ( ) ) {
112115 const newFileModel = oldFile . clone ( )
@@ -115,12 +118,10 @@ export default {
115118 newFileModel . set ( 'mtime' , Date . now ( ) )
116119 this . getFileList ( )
117120 . add ( newFileModel . toJSON ( ) )
118-
119- OC . Apps . hideAppSidebar ( )
120121 }
121122 } ,
122123
123- share ( ) {
124+ async share ( ) {
124125 if ( this . handlers . share && this . handlers . share ( this ) ) {
125126 return
126127 }
@@ -130,8 +131,10 @@ export default {
130131 return
131132 }
132133
133- OCA ?. Files ?. Sidebar ?. open ( this . filePath + '/' + this . fileName )
134- OCA ?. Files ?. Sidebar ?. setActiveTab ( 'sharing' )
134+ const node = await this . getFileNode ( )
135+ const sidebar = getSidebar ( )
136+ sidebar ?. open ( node )
137+ sidebar ?. setActiveTab ( 'sharing' )
135138 } ,
136139
137140 rename ( newName ) {
@@ -144,7 +147,7 @@ export default {
144147 }
145148
146149 if ( this . getFileList ( ) ) {
147- OC . Apps . hideAppSidebar ( )
150+ getSidebar ( ) ?. close ( )
148151 }
149152 } ,
150153
@@ -421,17 +424,20 @@ export default {
421424 avatardiv . append ( popover )
422425 } ,
423426
424- showRevHistory ( ) {
427+ async showRevHistory ( ) {
425428 if ( this . handlers . showRevHistory && this . handlers . showRevHistory ( this ) ) {
426429 return
427430 }
428431
429- if ( isPublicShare ( ) || ! OCA ?. Files ?. Sidebar ) {
432+ if ( isPublicShare ( ) ) {
430433 console . error ( '[FilesAppIntegration] Versions are not supported' )
431434 return
432435 }
433- OCA ?. Files ?. Sidebar ?. open ( this . filePath + '/' + this . fileName )
434- OCA ?. Files ?. Sidebar ?. setActiveTab ( 'files_versions' )
436+
437+ const node = await this . getFileNode ( )
438+ const sidebar = getSidebar ( )
439+ sidebar ?. open ( node )
440+ sidebar ?. setActiveTab ( 'files_versions' )
435441 } ,
436442
437443 /**
0 commit comments