diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts index 6581ec2f2..708c33e8e 100644 --- a/src/app/home/home.component.ts +++ b/src/app/home/home.component.ts @@ -14,7 +14,10 @@ import { ElectronService } from '../services/electron.service'; }) export class HomeComponent { /** Added playlists */ - playlists: Pick[] = []; + playlists: Pick< + Playlist, + 'count' | 'title' | 'filename' | '_id' | 'url' | 'importDate' + >[] = []; /** Loading spinner state */ isLoading = false; /** IPC Renderer commands list with callbacks */ @@ -25,7 +28,10 @@ export class HomeComponent { }, { id: 'playlist-all-result', - execute: (response: any) => (this.playlists = response.payload), + execute: (response: { payload: Partial }) => + (this.playlists = response.payload.sort((a, b) => + b.importDate.localeCompare(a.importDate) + )), }, { id: 'playlist-remove-by-id-result',