fix(files_sharing): open-in-files should open a folder and not the parent

For files this behavior is fine, but for folders the folder itself should be opened.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
Ferdinand Thiessen 2024-07-19 19:31:43 +02:00 committed by John Molakvoæ
parent fd14d66373
commit 5d2d98fefe

View file

@ -21,7 +21,7 @@
*/
import type { Node } from '@nextcloud/files'
import { registerFileAction, FileAction, DefaultType } from '@nextcloud/files'
import { registerFileAction, FileAction, DefaultType, FileType } from '@nextcloud/files'
import { translate as t } from '@nextcloud/l10n'
import { sharesViewId, sharedWithYouViewId, sharedWithOthersViewId, sharingByLinksViewId } from '../views/shares'
@ -41,6 +41,8 @@ export const action = new FileAction({
].includes(view.id),
async exec(node: Node) {
const isFolder = node.type === FileType.Folder
window.OCP.Files.Router.goToRoute(
null, // use default route
{ view: 'files', fileid: node.fileid },