From 96250be04a23f35974a5d4a2ec6d6d39fc00178e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 20 Dec 2019 14:16:54 -0500 Subject: [PATCH] Skip loading gravatars if user has third party icons deselected --- modules/ui/note_comments.js | 5 +++-- modules/ui/note_editor.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ui/note_comments.js b/modules/ui/note_comments.js index 9934eee4f..a16622bd7 100644 --- a/modules/ui/note_comments.js +++ b/modules/ui/note_comments.js @@ -6,7 +6,7 @@ import { services } from '../services'; import { utilDetect } from '../util/detect'; -export function uiNoteComments() { +export function uiNoteComments(context) { var _note; @@ -76,8 +76,9 @@ export function uiNoteComments() { function replaceAvatars(selection) { + var showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || 'true'; var osm = services.osm; - if (!osm) return; + if (showThirdPartyIcons !== 'true' || !osm) return; var uids = {}; // gather uids in the comment thread _note.comments.forEach(function(d) { diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index eeda102e8..06050cff9 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -28,7 +28,7 @@ import { export function uiNoteEditor(context) { var dispatch = d3_dispatch('change'); var quickLinks = uiQuickLinks(); - var noteComments = uiNoteComments(); + var noteComments = uiNoteComments(context); var noteHeader = uiNoteHeader(); // var formFields = uiFormFields(context);