@@ -4,27 +4,17 @@ import {Script, scriptAllowedForNodes} from "./types/script";
44import FileCog from '@mdi/svg/svg/file-cog.svg' ;
55import { emit } from "@nextcloud/event-bus"
66
7-
87export function reloadDirectory ( node : Node ) {
98 node && emit ( "files:node:updated" , node )
10-
11- // Legacy reload for public shares
12- const fileList = OCA ?. Sharing ?. PublicApp ?. fileList
13- if ( ! fileList ) {
14- return
15- }
16- fileList . changeDirectory ( fileList . getCurrentDirectory ( ) , true , true )
179}
1810
1911export type HandlerFunc = ( files : ActionContext ) => void ;
2012
21-
2213function buildActionObject ( myHandler : HandlerFunc , script : Script | null = null ) : IFileAction {
2314 const displayName = script ? script . title : t ( 'files_scripts' , 'More actions' )
2415 const id = 'files_scripts_action' + ( script ? script . id : "" )
2516 const order = 1000 + ( script ? 0 : 1 )
2617
27-
2818 return {
2919 id : id ,
3020 displayName : ( _ ) : string => displayName ,
@@ -45,35 +35,8 @@ function buildActionObject(myHandler: HandlerFunc, script: Script|null = null):
4535 } as IFileAction
4636}
4737
48- function nodeFromLegacy ( file : any ) : Node {
49- return {
50- get fileid ( ) : number | undefined {
51- return file . id
52- } ,
53- get basename ( ) : string {
54- return file . name
55- } ,
56- get path ( ) : string {
57- return file . path
58- }
59- } as Node
60- }
61-
62- function registerPublicSharingFileAction ( action : IFileAction , script : Script ) {
63- if ( ! OCA . Sharing || ! OCA . Sharing . PublicApp || ! OCA . Sharing . PublicApp . fileList ) {
64- return
65- }
66- // TODO fix register public file sharing
67- }
68-
6938export function registerMenuOption ( handler : HandlerFunc , script = null ) {
7039 const actionObject = buildActionObject ( handler , script )
7140 registerFileAction ( actionObject )
72-
73- // FIXME: Public shares are still using the legacy file viewer, if it ever updates to the Vue version
74- // we should update this code.
75- setTimeout ( ( ) => {
76- registerPublicSharingFileAction ( actionObject , script )
77- } , 2000 )
7841}
7942
0 commit comments