#144: Fixed
This commit is contained in:
@@ -14,6 +14,7 @@ namespace FoxTube
|
|||||||
{
|
{
|
||||||
public static class Methods
|
public static class Methods
|
||||||
{
|
{
|
||||||
|
public static bool NeedToResponse { get; set; } = false;
|
||||||
public static MainPage MainPage
|
public static MainPage MainPage
|
||||||
{
|
{
|
||||||
get { return (Window.Current.Content as Frame).Content as MainPage; }
|
get { return (Window.Current.Content as Frame).Content as MainPage; }
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ namespace FoxTube.Pages
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
channelId = id;
|
channelId = id;
|
||||||
|
if (Methods.NeedToResponse)
|
||||||
|
Methods.MainPage.content_Navigated(this, null);
|
||||||
|
|
||||||
ChannelsResource.ListRequest request = SecretsVault.Service.Channels.List("snippet,statistics,brandingSettings");
|
ChannelsResource.ListRequest request = SecretsVault.Service.Channels.List("snippet,statistics,brandingSettings");
|
||||||
request.Id = id;
|
request.Id = id;
|
||||||
if (content.Items.Count == 4)
|
if (content.Items.Count == 4)
|
||||||
@@ -133,8 +136,6 @@ namespace FoxTube.Pages
|
|||||||
|
|
||||||
if (SecretsVault.IsAuthorized)
|
if (SecretsVault.IsAuthorized)
|
||||||
{
|
{
|
||||||
SecretsVault.Subscriptions.ForEach(x => Debug.WriteLine($"{x.Snippet.Title}: {x.Snippet.ResourceId.ChannelId}"));
|
|
||||||
Debug.WriteLine($"Current channel ID: {item.Id}");
|
|
||||||
bool b = false;
|
bool b = false;
|
||||||
foreach (Subscription s in SecretsVault.Subscriptions)
|
foreach (Subscription s in SecretsVault.Subscriptions)
|
||||||
{
|
{
|
||||||
@@ -148,7 +149,6 @@ namespace FoxTube.Pages
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Debug.WriteLine($"Channel was found: {b}");
|
|
||||||
subscriptionPane.Visibility = Visibility.Visible;
|
subscriptionPane.Visibility = Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -502,7 +502,7 @@ namespace FoxTube
|
|||||||
s = Sender.None;
|
s = Sender.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void content_Navigated(object sender, NavigationEventArgs e)
|
public void content_Navigated(object sender, NavigationEventArgs e)
|
||||||
{
|
{
|
||||||
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
|
Dictionary<Type, Action> switchCase = new Dictionary<Type, Action>()
|
||||||
{
|
{
|
||||||
@@ -535,9 +535,16 @@ namespace FoxTube
|
|||||||
} },
|
} },
|
||||||
{ typeof(ChannelPage), () =>
|
{ typeof(ChannelPage), () =>
|
||||||
{
|
{
|
||||||
|
if(sender.GetType() != typeof(ChannelPage))
|
||||||
|
{
|
||||||
|
Methods.NeedToResponse = true;
|
||||||
|
s = Sender.None;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Methods.NeedToResponse = false;
|
||||||
if(SecretsVault.IsAuthorized)
|
if(SecretsVault.IsAuthorized)
|
||||||
{
|
{
|
||||||
if((content.Content as ChannelPage).channelId == SecretsVault.AccountId)
|
if((content.Content as ChannelPage).channelId == SecretsVault.UserChannel.Id)
|
||||||
{
|
{
|
||||||
if(nav.SelectedItem != toChannel)
|
if(nav.SelectedItem != toChannel)
|
||||||
nav.SelectedItem = toChannel;
|
nav.SelectedItem = toChannel;
|
||||||
@@ -559,14 +566,23 @@ namespace FoxTube
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!found)
|
if(!found)
|
||||||
|
{
|
||||||
nav.SelectedItem = null;
|
nav.SelectedItem = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
nav.SelectedItem = null;
|
nav.SelectedItem = null;
|
||||||
} },
|
} },
|
||||||
{ typeof(PlaylistPage), () =>
|
{ typeof(PlaylistPage), () =>
|
||||||
{
|
{
|
||||||
|
if(sender.GetType() != typeof(PlaylistPage))
|
||||||
|
{
|
||||||
|
Methods.NeedToResponse = true;
|
||||||
|
s = Sender.None;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Methods.NeedToResponse = false;
|
||||||
if((content.Content as PlaylistPage).playlistId == SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes)
|
if((content.Content as PlaylistPage).playlistId == SecretsVault.UserChannel.ContentDetails.RelatedPlaylists.Likes)
|
||||||
{
|
{
|
||||||
if(nav.SelectedItem != toLiked)
|
if(nav.SelectedItem != toLiked)
|
||||||
@@ -617,7 +633,7 @@ namespace FoxTube
|
|||||||
} }
|
} }
|
||||||
};
|
};
|
||||||
|
|
||||||
try { navCase[e.SourcePageType](); }
|
try { navCase[content.SourcePageType](); }
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
nav.SelectedItem = null;
|
nav.SelectedItem = null;
|
||||||
@@ -631,7 +647,7 @@ namespace FoxTube
|
|||||||
else
|
else
|
||||||
nav.IsBackEnabled = false;
|
nav.IsBackEnabled = false;
|
||||||
|
|
||||||
if (e.SourcePageType == typeof(Home) || e.SourcePageType == typeof(Settings) || e.SourcePageType == typeof(Subscriptions))
|
if (content.SourcePageType == typeof(Home) || content.SourcePageType == typeof(Settings) || content.SourcePageType == typeof(Subscriptions))
|
||||||
{
|
{
|
||||||
nav.ExpandedModeThresholdWidth = 1008;
|
nav.ExpandedModeThresholdWidth = 1008;
|
||||||
if (nav.DisplayMode == NavigationViewDisplayMode.Expanded)
|
if (nav.DisplayMode == NavigationViewDisplayMode.Expanded)
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ namespace FoxTube.Pages
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
playlistId = id;
|
playlistId = id;
|
||||||
|
if (Methods.NeedToResponse)
|
||||||
|
Methods.MainPage.content_Navigated(this, null);
|
||||||
|
|
||||||
PlaylistsResource.ListRequest request = SecretsVault.Service.Playlists.List("snippet,contentDetails");
|
PlaylistsResource.ListRequest request = SecretsVault.Service.Playlists.List("snippet,contentDetails");
|
||||||
request.Id = id;
|
request.Id = id;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user