diff --git a/src/Models/AvatarManager.cs b/src/Models/AvatarManager.cs index a380c1bc..6a68ac51 100644 --- a/src/Models/AvatarManager.cs +++ b/src/Models/AvatarManager.cs @@ -34,6 +34,9 @@ namespace SourceGit.Models if (!Directory.Exists(_storePath)) Directory.CreateDirectory(_storePath); + var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/Images/github.png", UriKind.RelativeOrAbsolute)); + _resources.Add("noreply@github.com", new Bitmap(icon)); + Task.Run(() => { while (true) @@ -117,17 +120,6 @@ namespace SourceGit.Models public static Bitmap Request(string email, bool forceRefetch) { - if (email.Equals("noreply@github.com", StringComparison.Ordinal)) - { - if (_githubEmailAvatar == null) - { - var icon = AssetLoader.Open(new Uri($"avares://SourceGit/Resources/Images/github.png", UriKind.RelativeOrAbsolute)); - _githubEmailAvatar = new Bitmap(icon); - } - - return _githubEmailAvatar; - } - if (forceRefetch) { if (_resources.ContainsKey(email)) @@ -198,6 +190,5 @@ namespace SourceGit.Models [GeneratedRegex(@"^(?:(\d+)\+)?(.+?)@users\.noreply\.github\.com$")] private static partial Regex REG_GITHUB_USER_EMAIL(); - private static Bitmap _githubEmailAvatar = null; } }