From f4677a7b7b43337e5b622cf47213272cc6b3d059 Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 3 Dec 2017 20:32:50 +0300 Subject: [PATCH] actually use the name when saving --- background/storage.js | 3 +++ edit/edit.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/background/storage.js b/background/storage.js index eee6a011..3d728473 100644 --- a/background/storage.js +++ b/background/storage.js @@ -238,6 +238,9 @@ function getStyles(options) { cachedStyles.byId.clear(); for (const style of cachedStyles.list) { cachedStyles.byId.set(style.id, style); + if (!style.name) { + style.name = 'ID: ' + style.id; + } } cachedStyles.mutex.inProgress = false; diff --git a/edit/edit.js b/edit/edit.js index 7b41edd0..78378c13 100644 --- a/edit/edit.js +++ b/edit/edit.js @@ -387,7 +387,7 @@ function save() { saveStyleSafe({ id: styleId, - name: name, + name: $('#name').value.trim(), enabled: $('#enabled').checked, reason: 'editSave', sections: getSectionsHashes()