1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Show the rule set generator only when there are new CDNs

This commit is contained in:
nobody
2020-07-24 08:16:25 +02:00
parent 107051e518
commit 7daee86505
4 changed files with 37 additions and 31 deletions

View File

@ -93,22 +93,19 @@ main._showReleaseNotes = function (details) {
});
} else if (details.reason === chrome.runtime.OnInstalledReason.UPDATE) {
let newValue = lastMappingUpdate;
let oldValue = "";
// If add-on update true, check last update of mappings.js
chrome.storage.sync.get([Setting.LAST_MAPPING_UPDATE, Setting.HIDE_RELEASE_NOTES], function (items) {
oldValue = items.lastMappingUpdate;
let mappingUpdate = items.lastMappingUpdate !== lastMappingUpdate;
if (oldValue !== newValue || !items.hideReleaseNotes) {
if (mappingUpdate || !items.hideReleaseNotes) {
// Updated mappings.js
chrome.storage.sync.set({
[Setting.LAST_MAPPING_UPDATE]: newValue
[Setting.LAST_MAPPING_UPDATE]: lastMappingUpdate
}, function() {
if (!items.hideReleaseNotes) {
chrome.tabs.create({
'url': chrome.extension.getURL('pages/updates/updates.html'),
'url': chrome.extension.getURL('pages/updates/updates.html?mappingupdate=' + mappingUpdate),
'active': false
});
}