Prevent showing wrong html

This commit is contained in:
M66B 2019-02-06 07:22:46 +00:00
parent 32651f48f8
commit cf777f3966
1 changed files with 8 additions and 2 deletions

View File

@ -1398,10 +1398,16 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override @Override
protected void onExecuted(Bundle args, String html) { protected void onExecuted(Bundle args, String html) {
properties.setHtml(message.id, html); long id = args.getLong("id");
properties.setHtml(id, html);
TupleMessageEx amessage = getMessage();
if (amessage == null || !amessage.id.equals(id))
return;
webView.loadDataWithBaseURL("email://", html, "text/html", "UTF-8", null); webView.loadDataWithBaseURL("email://", html, "text/html", "UTF-8", null);
boolean expanded = properties.getValue("expanded", message.id); boolean expanded = properties.getValue("expanded", id);
pbBody.setVisibility(View.GONE); pbBody.setVisibility(View.GONE);
webView.setVisibility(expanded ? View.VISIBLE : View.GONE); webView.setVisibility(expanded ? View.VISIBLE : View.GONE);
} }