fix broken links on non-owned channels
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (channel of channels(); track channel.channel_id) {
|
||||
<tr class="clickable-row" (click)="viewChannel(channel)">
|
||||
<tr [class.clickable-row]="isOwned(channel)" (click)="isOwned(channel) && viewChannel(channel)">
|
||||
<td>
|
||||
<div class="channel-name">{{ channel.display_name }}</div>
|
||||
@if (channel.description_name) {
|
||||
|
||||
@@ -78,6 +78,10 @@ export class ChannelListComponent implements OnInit {
|
||||
return resolved?.displayName || ownerId;
|
||||
}
|
||||
|
||||
isOwned(channel: ChannelWithSubscription): boolean {
|
||||
return channel.owner_user_id === this.authService.getUserId();
|
||||
}
|
||||
|
||||
viewChannel(channel: ChannelWithSubscription): void {
|
||||
this.router.navigate(['/channels', channel.channel_id]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user