diff --git a/FoxTube/Assets/Data/Patchnotes.xml b/FoxTube/Assets/Data/Patchnotes.xml index 8a84cae..81216eb 100644 --- a/FoxTube/Assets/Data/Patchnotes.xml +++ b/FoxTube/Assets/Data/Patchnotes.xml @@ -3,6 +3,7 @@ ### What's new: +- App optimization - Changelog notification now pops up after update at first launch - Added ability to add videos to playlists on video page - Added ability to add videos to playlists through card's context menu @@ -14,6 +15,7 @@ - Some items were moved from menu to header ### Что нового: +- Оптимизация приложения - Добавлено уведомление со списком изменений при первом запуске после обновления - Добавлена возможность добавлять видео в плейлисты на странице просмотра - Добавлена возможность добавлять видео в плейлисты через контекстное меню карточки diff --git a/FoxTube/Classes/Methods.cs b/FoxTube/Classes/Methods.cs index 4be9f0a..f6ebd82 100644 --- a/FoxTube/Classes/Methods.cs +++ b/FoxTube/Classes/Methods.cs @@ -42,10 +42,13 @@ namespace FoxTube public static Uri ToUri(this string url) { - return new Uri(url); + if (string.IsNullOrWhiteSpace(url)) + return null; + else + return new Uri(url); } - public static string GuardFromNull(this string str) + public static string GuardFromNull(string str) { if (string.IsNullOrWhiteSpace(str)) return string.Empty; @@ -53,11 +56,6 @@ namespace FoxTube return str; } - public static bool IsNullOrWhiteSpace(this string str) - { - return string.IsNullOrWhiteSpace(str); - } - public static string GetChars(this string str, int count) { try diff --git a/FoxTube/Controls/Adverts/CardAdvert.xaml.cs b/FoxTube/Controls/Adverts/CardAdvert.xaml.cs index bb4c976..c39c37a 100644 --- a/FoxTube/Controls/Adverts/CardAdvert.xaml.cs +++ b/FoxTube/Controls/Adverts/CardAdvert.xaml.cs @@ -47,19 +47,19 @@ namespace FoxTube.Controls.Adverts icon.ProfilePicture = advert.AdIcon == null ? null : advert.AdIcon.Source; - sponsor.Text = advert.SponsoredBy.GuardFromNull(); + sponsor.Text = Methods.GuardFromNull(advert.SponsoredBy); - if (advert.CallToActionText.IsNullOrWhiteSpace()) + if (string.IsNullOrWhiteSpace(advert.CallToActionText)) (info.Parent as FrameworkElement).Visibility = Visibility.Collapsed; else info.Text = advert.CallToActionText; desc.Text = string.Empty; - if (!advert.Price.IsNullOrWhiteSpace()) + if (!string.IsNullOrWhiteSpace(advert.Price)) desc.Text += advert.Price; - if (!advert.Rating.IsNullOrWhiteSpace()) + if (!string.IsNullOrWhiteSpace(advert.Rating)) desc.Text += " " + advert.Rating; show.Begin(); diff --git a/FoxTube/Controls/Adverts/CommentAdvert.xaml b/FoxTube/Controls/Adverts/CommentAdvert.xaml index 39d1fc2..babef6c 100644 --- a/FoxTube/Controls/Adverts/CommentAdvert.xaml +++ b/FoxTube/Controls/Adverts/CommentAdvert.xaml @@ -18,8 +18,9 @@ - + +