Skip to content

Commit

Permalink
Fixed remove from on deck not refreshing dashboard.
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Jan 25, 2024
1 parent 5aabefa commit 8a45bae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<app-carousel-reel [items]="data" [title]="t('on-deck-title')" (sectionClick)="handleSectionClick(StreamId.OnDeck)">
<ng-template #carouselItem let-item>
<app-series-card [data]="item" [libraryId]="item.libraryId" [isOnDeck]="true"
(reload)="reloadStream(stream.id)" (dataChanged)="reloadStream(stream.id)"></app-series-card>
(reload)="reloadStream(stream.id, true)" (dataChanged)="reloadStream(stream.id)"></app-series-card>
</ng-template>
</app-carousel-reel>
}
Expand Down
13 changes: 9 additions & 4 deletions UI/Web/src/app/dashboard/_components/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,17 @@ export class DashboardComponent implements OnInit {
this.cdRef.markForCheck();
}

reloadStream(streamId: number) {
reloadStream(streamId: number, onDeck = false) {
const index = this.streams.findIndex(s => s.id === streamId);
if (index < 0) return;
this.streams[index] = {...this.streams[index]};
console.log('swapped out stream: ', this.streams[index]);
this.cdRef.detectChanges();
if (onDeck) {
// TODO: Need to figure out a better way to refresh just one stream
this.refreshStreams$.next();
this.cdRef.markForCheck();
} else {
this.streams[index] = {...this.streams[index]};
this.cdRef.markForCheck();
}
}

async handleRecentlyAddedChapterClick(item: RecentlyAddedItem) {
Expand Down

0 comments on commit 8a45bae

Please sign in to comment.