Minor perf improvement when conversation load was cancelled.

Lazily initialise the ConversationMessage's web onlt after checking to
see if the conversation load as been cancelled or not.
This commit is contained in:
Michael Gratton 2019-11-26 14:21:50 +11:00 committed by Michael James Gratton
parent ec155ed707
commit 1a391758fa

View file

@ -819,13 +819,14 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
public async void load_message_body(Geary.RFC822.Message message,
GLib.Cancellable load_cancelled)
throws GLib.Error {
if (this.web_view == null)
initialize_web_view();
if (load_cancelled.is_cancelled()) {
throw new GLib.IOError.CANCELLED("Conversation load cancelled");
}
if (this.web_view == null) {
initialize_web_view();
}
bool contact_load_images = (
this.primary_contact != null &&
this.primary_contact.load_remote_resources