From 9c907f37e062935cc65a4e12677f009ba57e2b31 Mon Sep 17 00:00:00 2001 From: MatMoul Date: Sun, 15 Oct 2017 00:51:50 +0200 Subject: [PATCH] Improvement: Update thumbnails when url has changed --- src/js/background.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/js/background.js b/src/js/background.js index cb4a212..ffa3b1f 100644 --- a/src/js/background.js +++ b/src/js/background.js @@ -448,12 +448,14 @@ app.GridNodes.getNodeWithParents = function(id){ app.GridNodes.updateNode = function(gridNode, value, callback){ if(value){ if(value.title) gridNode.title = value.title; - if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){ - gridNode.url = value.url; - delete gridNode.image; - } if(value.image) gridNode.image = value.image; else delete gridNode.image; + if(gridNode.type == app.GridNodes.GridNodeType.bookmark && value.url && gridNode.url != value.url){ + gridNode.url = value.url; + app.GridNodes.refreshNode(gridNode, function(){ + browser.runtime.sendMessage({ cmd: app.Messages.Commands.gridNodesLoaded }); + }); + } app.GridNodes.saveNode(gridNode); } if(callback) callback(gridNode);