Skip to content

Commit 7fd0f20

Browse files
authored
Merge pull request #617 from 4gray/fix/reorder-favorites
fix/reorder-favorites
2 parents 2fda888 + 0e2ba6b commit 7fd0f20

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

src/app/player/components/channel-list-container/channel-list-container.component.html

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@
5757
</ng-template>
5858
<mat-nav-list id="groups-list">
5959
<mat-accordion multi>
60-
@for (groups of groupedChannels | keyvalue: groupsComparator; track $index) {
60+
@for (
61+
groups of groupedChannels | keyvalue: groupsComparator;
62+
track $index
63+
) {
6164
@if (groups.value.length > 0) {
6265
<mat-expansion-panel>
6366
<mat-expansion-panel-header>
@@ -70,13 +73,11 @@
7073
</mat-expansion-panel-header>
7174

7275
<ng-template matExpansionPanelContent>
73-
<ng-container
74-
*ngFor="
75-
let channel of groups.value;
76-
index as i;
77-
trackBy: trackByFn
78-
"
79-
>
76+
@for (
77+
channel of groups.value;
78+
track trackByFn($index, channel);
79+
let i = $index
80+
) {
8081
<app-channel-list-item
8182
[name]="
8283
i +
@@ -92,7 +93,7 @@
9293
selected?.id === channel.id
9394
"
9495
></app-channel-list-item>
95-
</ng-container>
96+
}
9697
</ng-template>
9798
</mat-expansion-panel>
9899
}
@@ -118,28 +119,30 @@
118119
id="favorites-list"
119120
>
120121
@if (favorites.length > 0) {
121-
<app-channel-list-item
122-
*ngFor="
123-
let channel of favorites;
124-
index as i;
125-
trackBy: trackByFn
126-
"
127-
[name]="
128-
i +
129-
1 +
130-
'. ' +
131-
(channel?.name || 'CHANNELS.UNNAMED_CHANNEL'
132-
| translate)
133-
"
134-
[isDraggable]="true"
135-
[logo]="channel?.tvg?.logo"
136-
(clicked)="selectChannel(channel)"
137-
[selected]="selected?.id === channel?.id"
138-
[showFavoriteButton]="true"
139-
(favoriteToggled)="
140-
toggleFavoriteChannel(channel, $event)
141-
"
142-
/>
122+
@for (
123+
channel of favorites;
124+
track trackByFn($index, channel);
125+
let i = $index
126+
) {
127+
<app-channel-list-item
128+
[name]="
129+
i +
130+
1 +
131+
'. ' +
132+
(channel?.name ||
133+
'CHANNELS.UNNAMED_CHANNEL'
134+
| translate)
135+
"
136+
[isDraggable]="true"
137+
[logo]="channel?.tvg?.logo"
138+
(clicked)="selectChannel(channel)"
139+
[selected]="selected?.id === channel?.id"
140+
[showFavoriteButton]="true"
141+
(favoriteToggled)="
142+
toggleFavoriteChannel(channel, $event)
143+
"
144+
/>
145+
}
143146
} @else {
144147
<mat-list-item
145148
><strong>{{

src/app/player/components/channel-list-container/channel-list-container.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class ChannelListContainerComponent {
163163
moveItemInArray(favorites, event.previousIndex, event.currentIndex);
164164
this.store.dispatch(
165165
PlaylistActions.setFavorites({
166-
channelIds: favorites.map((item) => item.id),
166+
channelIds: favorites.map((item) => item.url),
167167
})
168168
);
169169
}

0 commit comments

Comments
 (0)