mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-22 20:37:19 -08:00
optimize<Avatar>: cache downloading failed avatars
This commit is contained in:
parent
fa3ff6f2db
commit
f4ab97c088
1 changed files with 12 additions and 7 deletions
|
@ -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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue