From 59b5891d8ff9b6e8c879fd0b7ea48585cd107a73 Mon Sep 17 00:00:00 2001 From: Dinesh Solanki <15937452+DineshSolanki@users.noreply.github.com> Date: Sun, 8 Aug 2021 23:41:53 +0530 Subject: [PATCH] fixed all exception making to user screen meant for debugging. --- FoliCon/ViewModels/PosterPickerViewModel.cs | 11 ++++++----- FoliCon/ViewModels/SearchResultViewModel.cs | 10 +++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/FoliCon/ViewModels/PosterPickerViewModel.cs b/FoliCon/ViewModels/PosterPickerViewModel.cs index 8b5b16fb..0c624c33 100644 --- a/FoliCon/ViewModels/PosterPickerViewModel.cs +++ b/FoliCon/ViewModels/PosterPickerViewModel.cs @@ -8,7 +8,6 @@ using System; using System.Collections.ObjectModel; using System.Globalization; -using System.IO; using FoliCon.Properties.Langs; using IGDB; using IGDB.Models; @@ -65,9 +64,11 @@ private void OpenImageMethod(object parameter) var link = (string)parameter; var browser = new ImageBrowser(Result.MediaType == MediaTypes.Game ? $"https://{ImageHelper.GetImageUrl(link, ImageSize.HD720)[2..]}" - : link); - browser.ShowTitle = false; - browser.IsFullScreen = true; + : link) + { + ShowTitle = false, + IsFullScreen = true + }; browser.Show(); } @@ -108,7 +109,7 @@ public void OnDialogOpened(IDialogParameters parameters) LoadData(); } - public async void LoadData() + public void LoadData() { var resultType = Result.MediaType; var response = _isPickedById diff --git a/FoliCon/ViewModels/SearchResultViewModel.cs b/FoliCon/ViewModels/SearchResultViewModel.cs index eaa92db0..d4b4af0c 100644 --- a/FoliCon/ViewModels/SearchResultViewModel.cs +++ b/FoliCon/ViewModels/SearchResultViewModel.cs @@ -296,9 +296,13 @@ private void MouseDoubleClick() } catch (Exception ex) { - MessageBox.Show(ex.Message == "NoPoster" - ? CustomMessageBox.Warning(LangProvider.GetLang("NoPosterFound"), SearchTitle) - : CustomMessageBox.Warning(ex.Message, LangProvider.GetLang("ExceptionOccurred"))); + if (ex.Message == "NoPoster") + { + MessageBox.Show(CustomMessageBox.Warning(LangProvider.GetLang("NoPosterFound"), SearchTitle)); + } +#if DEBUG + MessageBox.Show(CustomMessageBox.Warning(ex.Message, LangProvider.GetLang("ExceptionOccurred"))); +#endif } } }