Skip to content

Commit 0567f26

Browse files
committed
fix(files): preserve view-in-folder guards
Keep the action limited to user-root files while replacing the view-based condition with a folder-location comparison. Assisted-by: OpenCode:gpt-5.6-sol
1 parent 717cf09 commit 0567f26

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

apps/files/src/actions/viewInFolderAction.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const action: IFileAction = {
1717
},
1818
iconSvgInline: () => FolderEyeSvg,
1919

20-
enabled({ nodes, view, folder }) {
20+
enabled({ nodes, folder }) {
2121
// Not enabled for public shares
2222
if (isPublicShare()) {
2323
return false
@@ -33,8 +33,13 @@ export const action: IFileAction = {
3333
return false
3434
}
3535

36+
// Can only view files that are in the user root folder
37+
if (!node.root?.startsWith('/files')) {
38+
return false
39+
}
40+
3641
// Only show if not in same folder
37-
if (folder.path == node.dirname) {
42+
if (folder.path === node.dirname) {
3843
return false
3944
}
4045

0 commit comments

Comments
 (0)