From aa3c1c8431173273ef4edd8754f02bb10947e42b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sun, 4 Dec 2016 21:47:46 -0500 Subject: [PATCH] All sources have id now, so compare by id Fixes an issue where a source might not compare strictly equal e.g.: 1. custom imagery gets blacklisted and replaced with a `rendererBackgroundSource.None()` 2. which doesn't strictly === the `rendererBackgroundSource.None()` on the background pane switcher 3. so the radio button would not appear checked --- modules/renderer/background.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/renderer/background.js b/modules/renderer/background.js index 46284acad..0a37d6511 100644 --- a/modules/renderer/background.js +++ b/modules/renderer/background.js @@ -165,9 +165,8 @@ export function rendererBackground(context) { background.showsLayer = function(d) { - return d === baseLayer.source() || - (d.id === 'custom' && baseLayer.source().id === 'custom') || - overlayLayers.some(function(l) { return l.source() === d; }); + return d.id === baseLayer.source().id || + overlayLayers.some(function(layer) { return d.id === layer.source().id; }); };