diff --git a/Toastify/src/App.xaml.cs b/Toastify/src/App.xaml.cs index 300dadc8..6dcea03d 100644 --- a/Toastify/src/App.xaml.cs +++ b/Toastify/src/App.xaml.cs @@ -467,7 +467,17 @@ public static Thread CallInSTAThreadAsync(Action action, bool background, string if (action == null) return null; - Thread t = new Thread(() => action()) + Thread t = new Thread(() => + { + try + { + action(); + } + catch (Exception ex) + { + logger.Error($"Unknown error in {nameof(CallInSTAThreadAsync)}", ex); + } + }) { IsBackground = background }; diff --git a/Toastify/src/Helpers/Markdown/Markdown.Styles.xaml b/Toastify/src/Helpers/Markdown/Markdown.Styles.xaml index fefe82e9..f0583cee 100644 --- a/Toastify/src/Helpers/Markdown/Markdown.Styles.xaml +++ b/Toastify/src/Helpers/Markdown/Markdown.Styles.xaml @@ -23,13 +23,13 @@ diff --git a/Toastify/src/View/ChangelogView.xaml b/Toastify/src/View/ChangelogView.xaml index 1180f3b5..ba024ba8 100644 --- a/Toastify/src/View/ChangelogView.xaml +++ b/Toastify/src/View/ChangelogView.xaml @@ -8,7 +8,7 @@ xmlns:viewmodel="clr-namespace:Toastify.ViewModel" mc:Ignorable="d" Title="Toastify - Changelog" Height="520" MaxHeight="520" Width="480" SizeToContent="Height" ResizeMode="NoResize" - WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" Topmost="True" Icon="/Toastify;component/Resources/ToastifyIcon.ico"> + WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" Icon="/Toastify;component/Resources/ToastifyIcon.ico"> diff --git a/Toastify/src/View/ChangelogView.xaml.cs b/Toastify/src/View/ChangelogView.xaml.cs index d2ade883..8fbdd774 100644 --- a/Toastify/src/View/ChangelogView.xaml.cs +++ b/Toastify/src/View/ChangelogView.xaml.cs @@ -15,7 +15,7 @@ public partial class ChangelogView : Window { private static readonly ILog logger = LogManager.GetLogger(typeof(ChangelogView)); - private static ChangelogView current; + private static bool showed; private readonly ChangelogViewModel viewModel; @@ -29,18 +29,21 @@ public ChangelogView() internal static void Launch() { - if (current != null) + if (showed) return; if (logger.IsDebugEnabled) logger.Debug("Launching ChangelogViewer..."); - current = new ChangelogView(); App.CallInSTAThreadAsync(() => { - current.DownloadChangelog(); - current.Show(); + ChangelogView changelogView = new ChangelogView(); + changelogView.DownloadChangelog(); + + showed = true; + changelogView.Show(); SystemSounds.Asterisk.Play(); + Dispatch.Run(); }, true, "Changelog Viewer"); } diff --git a/ToastifyAPI/GitHub/GitHubAPI.cs b/ToastifyAPI/GitHub/GitHubAPI.cs index 1da9a196..ebc7be55 100644 --- a/ToastifyAPI/GitHub/GitHubAPI.cs +++ b/ToastifyAPI/GitHub/GitHubAPI.cs @@ -107,8 +107,6 @@ private T DownloadJsonInternal(string url) private static readonly Regex issueOrPullRegex = new Regex(@"\B#([0-9]+)\b", RegexOptions.Compiled); - private static readonly Regex hashRegex = new Regex(@"\b([a-f0-9]{7,})\b", RegexOptions.Compiled); - private static readonly Regex emojiRegex = new Regex(@":([^\s]+):", RegexOptions.Compiled); public string GitHubify(string ghText) @@ -130,14 +128,6 @@ public string GitHubify(string ghText) return match.Result(pattern); }); - // Hashes ([a-f0-9]{7,}) - ghText = hashRegex.Replace(ghText, match => - { - string hash = match.Groups[1].Value; - string pattern = this.GitHubify_Hash(hash); - return match.Result(pattern); - }); - // Emojis (::) ghText = emojiRegex.Replace(ghText, match => {