Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

refactor(frontend:files): simplify context menu conditionals in spaces browser component

johaven277f61cd5105
diff --git a/frontend/src/app/applications/spaces/components/spaces-browser.component.html b/frontend/src/app/applications/spaces/components/spaces-browser.component.html
index a560b13d..245db6fa 100644
--- a/frontend/src/app/applications/spaces/components/spaces-browser.component.html
+++ b/frontend/src/app/applications/spaces/components/spaces-browser.component.html
@@ -526,12 +526,10 @@
<!--End Common Messages-->
<!--Start Context Menu -->
<context-menu #FileContextMenu>
- @if (selection.length === 1) {
- @if (selection[0]) {
- <ng-template (execute)="shortcutOpen()" contextMenuItem>
- <span l10nTranslate><fa-icon [icon]="selection[0].isDir ? icons.faFolderOpen : icons.faEye"></fa-icon>Open</span>
- </ng-template>
- }
+ @if (selection.length === 1 && selection[0]; as selectedFile) {
+ <ng-template (execute)="shortcutOpen()" contextMenuItem>
+ <span l10nTranslate><fa-icon [icon]="selectedFile.isDir ? icons.faFolderOpen : icons.faEye"></fa-icon>Open</span>
+ </ng-template>
}
@if (!hasDisabledItemsInSelection) {
<ng-template (execute)="downloadFiles()" contextMenuItem>