File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 4
4
*/
5
5
6
6
import { loadState } from '@nextcloud/initial-state'
7
- import { registerFileAction } from '@nextcloud/files'
7
+ import { registerFileAction , getFileActions } from '@nextcloud/files'
8
8
9
9
import { setupWebDavDecryptionProxy } from './services/webDavProxy.ts'
10
10
import downloadUnencryptedAction from './services/downloadUnencryptedAction.ts'
11
+ import logger from './services/logger.ts'
11
12
12
13
const userConfig = loadState ( 'end_to_end_encryption' , 'userConfig' , { e2eeInBrowserEnabled : false } )
13
14
14
15
if ( userConfig . e2eeInBrowserEnabled ) {
15
16
setupWebDavDecryptionProxy ( )
16
17
registerFileAction ( downloadUnencryptedAction )
18
+ disableFileAction ( 'download' )
19
+ disableFileAction ( 'move-copy' )
17
20
}
21
+
22
+ function disableFileAction ( actionId : string ) {
23
+ logger . debug ( 'Disabling file action' , { actionId } )
24
+ const actions = getFileActions ( )
25
+ const action = actions . find ( action => action . id === actionId ) as any
26
+ action . _action . enabled = ( ) => false
27
+ }
You can’t perform that action at this time.
0 commit comments