diff options
author | Florrie <towerofnix@gmail.com> | 2019-03-24 08:49:43 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2019-03-24 08:49:43 -0300 |
commit | 6f5e2d9b568504b681bcfaf3405d059b900bb4b1 (patch) | |
tree | 40186829d18e24a7a6c64ec2b53824e2641bd314 /extension/popup | |
parent | a55a4500ee8262d4c9c50d7c769ebc8cb742bb93 (diff) |
Update rule list as soon as a new rule is added
I.e. by saving. Also reflect changes in the rule list when the rule's scope is modified.
Diffstat (limited to 'extension/popup')
-rw-r--r-- | extension/popup/main.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/extension/popup/main.js b/extension/popup/main.js index c628447..1bf653a 100644 --- a/extension/popup/main.js +++ b/extension/popup/main.js @@ -33,6 +33,7 @@ function changeContentScreen(id) { function loadTrackList(opts) { const {tab, rule, saveRule, deleteRule} = opts; const {music} = rule; + saveRule(); return browser.storage.sync.get('tracks').then(({tracks = []}) => { const ul = document.getElementById('track-list'); while (ul.firstChild) { @@ -385,7 +386,8 @@ Promise.all([ siteSettings.push(rule); } return browser.storage.sync.set({siteSettings}) - .then(() => browser.runtime.sendMessage({music: rule.music})); + .then(() => browser.runtime.sendMessage({music: rule.music})) + .then(() => reloadRuleList()); }, deleteRule: () => { changeScreen('loading-screen'); |