]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/buttons/action-dropdown.component.ts
Fix upnext, refactor avatar menu, add to playlist overflow
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / buttons / action-dropdown.component.ts
index c9dbbfda243035c10b905903ae5ba594e6f0de9e..a4200f70f7ad97417fa98967a0f8872178b96e4a 100644 (file)
@@ -38,7 +38,11 @@ export class ActionDropdownComponent<T> {
     return [ this.actions ]
   }
 
-  areActionsDisplayed (actions: DropdownAction<T>[], entry: T) {
-    return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry))
+  areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean {
+    return actions.some(a => {
+      if (Array.isArray(a)) return this.areActionsDisplayed(a, entry)
+
+      return a.isDisplayed === undefined || a.isDisplayed(entry)
+    })
   }
 }