mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-22 13:51:15 +08:00
optimize<Avatar>: cache downloading failed avatars
This commit is contained in:
@@ -190,15 +190,20 @@ namespace SourceGit.Helpers {
|
||||
reader.CopyTo(writer);
|
||||
}
|
||||
|
||||
if (requesting.ContainsKey(email)) {
|
||||
Dispatcher.Invoke(() => {
|
||||
var img = new BitmapImage(new Uri(filePath));
|
||||
loaded[email] = img;
|
||||
Dispatcher.Invoke(() => {
|
||||
var img = new BitmapImage(new Uri(filePath));
|
||||
loaded.Add(email, img);
|
||||
|
||||
if (requesting.ContainsKey(email)) {
|
||||
foreach (var one in requesting[email]) one.Source = img;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
loaded.Add(email, null);
|
||||
}
|
||||
} catch { }
|
||||
} catch {
|
||||
loaded.Add(email, null);
|
||||
}
|
||||
|
||||
requesting.Remove(email);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user