Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
I'm so fucking bad! Only slept 2 hours tonight! Fixed ChangelogView
Browse files Browse the repository at this point in the history
  • Loading branch information
aleab committed Mar 31, 2018
1 parent 1fa5392 commit e3742bb
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
12 changes: 11 additions & 1 deletion Toastify/src/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down
4 changes: 2 additions & 2 deletions Toastify/src/Helpers/Markdown/Markdown.Styles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@

<Style x:Key="H3Style" TargetType="Paragraph">
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="#99000000" />
<Setter Property="Foreground" Value="#ff000000" />
<Setter Property="FontWeight" Value="Bold" />
</Style>

<Style x:Key="H4Style" TargetType="Paragraph">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="#99000000" />
<Setter Property="Foreground" Value="#ff000000" />
<Setter Property="FontWeight" Value="Bold" />
</Style>

Expand Down
2 changes: 1 addition & 1 deletion Toastify/src/View/ChangelogView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">

<Window.Resources>
<ResourceDictionary>
Expand Down
13 changes: 8 additions & 5 deletions Toastify/src/View/ChangelogView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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");
}
Expand Down
10 changes: 0 additions & 10 deletions ToastifyAPI/GitHub/GitHubAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ private T DownloadJsonInternal<T>(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)
Expand All @@ -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 =>
{
Expand Down

0 comments on commit e3742bb

Please sign in to comment.