fix: playlists is undefined in init state
This commit is contained in:
		@ -9,7 +9,7 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
 | 
			
		||||
})
 | 
			
		||||
export class DataproviderService {
 | 
			
		||||
 | 
			
		||||
  private apiUrl = "http://127.0.0.1:616/api.php";
 | 
			
		||||
  private apiUrl = "http://127.0.0.1:4000/api.php";
 | 
			
		||||
 | 
			
		||||
  constructor(
 | 
			
		||||
    private http: HttpClient
 | 
			
		||||
@ -64,7 +64,7 @@ export class DataproviderService {
 | 
			
		||||
  mock_FILELISTAAAA : FileList;
 | 
			
		||||
  mock_FILELISTBBBB : FileList;
 | 
			
		||||
  
 | 
			
		||||
  getFileList(path : string) : Observable<FileList> {
 | 
			
		||||
  getFileListReal(path : string) : Observable<FileList> {
 | 
			
		||||
    switch (path) {
 | 
			
		||||
      case "AAAA":
 | 
			
		||||
        return of(this.mock_FILELISTAAAA);
 | 
			
		||||
@ -75,7 +75,7 @@ export class DataproviderService {
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  getFileListReal(path : string) : Observable<FileList> {
 | 
			
		||||
  getFileList(path : string) : Observable<FileList> {
 | 
			
		||||
    const body = new HttpParams()
 | 
			
		||||
      .set('do', 'getfilelist')
 | 
			
		||||
      .set('folder', path);
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
<mat-nav-list>
 | 
			
		||||
<mat-nav-list *ngIf="filelist">
 | 
			
		||||
  <mat-list-item *ngFor="let folderItem of filelist.subFolderList" (click)="requestPlaylist(folderItem)">
 | 
			
		||||
    <mat-icon matListIcon>folder</mat-icon>
 | 
			
		||||
    <a>{{ folderItem }}</a>
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user