mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -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);
|
reader.CopyTo(writer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (requesting.ContainsKey(email)) {
|
Dispatcher.Invoke(() => {
|
||||||
Dispatcher.Invoke(() => {
|
var img = new BitmapImage(new Uri(filePath));
|
||||||
var img = new BitmapImage(new Uri(filePath));
|
loaded.Add(email, img);
|
||||||
loaded[email] = img;
|
|
||||||
|
if (requesting.ContainsKey(email)) {
|
||||||
foreach (var one in requesting[email]) one.Source = img;
|
foreach (var one in requesting[email]) one.Source = img;
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
} else {
|
||||||
|
loaded.Add(email, null);
|
||||||
}
|
}
|
||||||
} catch { }
|
} catch {
|
||||||
|
loaded.Add(email, null);
|
||||||
|
}
|
||||||
|
|
||||||
requesting.Remove(email);
|
requesting.Remove(email);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue