private async Task SavePlaylist() { string idList = string.Join("|", PlaylistTracks.Select(p => p.Id)); Wrap.Cookie playlistCookie = new Wrap.Cookie("playlist", JsRuntime); await playlistCookie.Set(idList); }
private async Task LoadPlaylist() { Wrap.Cookie playlistCookie = new Wrap.Cookie("playlist", JsRuntime); string sidList = await playlistCookie.Get(); if (sidList != null) { (await Data.GetTracks(sidList)).ForEach(t => { if (!PlaylistTracks.Any(p => p.Id == t.Id)) { PlaylistTracks.Add(t); } }); } if (PlaylistTracks.Count > 0) { this.StateHasChanged(); } }