Archived
1
0

Refactored core

UI navigation framework

Related Work Items: #408, #414, #416
This commit is contained in:
Michael Gordeev
2020-06-15 15:46:38 +03:00
parent c58d846057
commit 787a6e9f48
72 changed files with 2002 additions and 1227 deletions
-15
View File
@@ -5,12 +5,10 @@ using Google.Apis.Oauth2.v2.Data;
using Google.Apis.Services;
using Google.Apis.YouTube.v3;
using Google.Apis.YouTube.v3.Data;
using Newtonsoft.Json;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Windows.Storage;
using YouTube;
using YoutubeExplode;
using FoxTube.Services;
@@ -42,8 +40,6 @@ namespace FoxTube.Models
UserService.SubscriptionsChangedInvoker(this, subscription);
Subscriptions.Remove(subscription);
SaveSubscriptions();
return false;
}
else
@@ -79,21 +75,10 @@ namespace FoxTube.Models
Subscriptions.Add(subscription);
UserService.SubscriptionsChangedInvoker(this, subscription);
SaveSubscriptions();
return true;
}
}
private void SaveSubscriptions()
{
Dictionary<string, string> subs = Subscriptions.Select(i =>
new KeyValuePair<string, string>(i.ChannelId, i.Avatar.Default__?.Url))
as Dictionary<string, string>;
ApplicationData.Current.RoamingSettings.Values[$"Subscriptions.{UserInfo.Id}"] = JsonConvert.SerializeObject(subs);
}
public static async Task<User> GetUser(UserCredential credential)
{
User user = new User