Skip to content

Commit b956f14

Browse files
committed
cleanup: remove legacy integrations with files app
Signed-off-by: Raul Ferreira Fuentes <r.ferreira.fuentes@gmail.com>
1 parent df801cb commit b956f14

1 file changed

Lines changed: 0 additions & 37 deletions

File tree

src/files.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,17 @@ import {Script, scriptAllowedForNodes} from "./types/script";
44
import FileCog from '@mdi/svg/svg/file-cog.svg';
55
import {emit} from "@nextcloud/event-bus"
66

7-
87
export 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

1911
export type HandlerFunc = (files: ActionContext) => void;
2012

21-
2213
function 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-
6938
export 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

Comments
 (0)