Skip to content
This repository was archived by the owner on Feb 8, 2026. It is now read-only.

Commit 45b71dc

Browse files
authored
Merge pull request #53 from joelthorner/2.x
Fix notify new version
2 parents e637ff8 + e3776a6 commit 45b71dc

3 files changed

Lines changed: 24 additions & 7 deletions

File tree

js/background.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,23 @@ var opt = {
9393
]
9494
};
9595

96-
chrome.notifications.create('newVersion-' + manifestData, opt, function() {
96+
chrome.storage.sync.get(['newVersionNotify'], function(result) {
9797

98-
});
98+
if (typeof result.newVersionNotify == 'undefined') {
99+
result.newVersionNotify = false;
100+
}
99101

100-
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex) {
101-
if (notificationId == 'newVersion-' + manifestData && buttonIndex == 1) {
102-
chrome.tabs.create({ url: chrome.extension.getURL("/src/options/index.html") });
102+
if (manifestData.version != result.newVersionNotify) {
103+
chrome.notifications.create('newVersion-' + manifestData.version, opt, function() {
104+
chrome.storage.sync.set({
105+
newVersionNotify: manifestData.version
106+
});
107+
});
108+
109+
chrome.notifications.onButtonClicked.addListener(function(notificationId, buttonIndex) {
110+
if (notificationId == 'newVersion-' + manifestData.version && buttonIndex == 1) {
111+
chrome.tabs.create({ url: chrome.extension.getURL("/src/options/index.html") });
112+
}
113+
});
103114
}
104-
});
115+
});

js/optionsData.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ var AVATARS /* The legend of Aang */ = [
9595
var CHANGELOG = [
9696

9797
{
98+
version: "2.1.1",
99+
date: "23 Sep 2018",
100+
lines: [
101+
"Fix notify"
102+
]
103+
}, {
98104
version: "2.1.0",
99105
date: "21 Sep 2018",
100106
lines: [

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "TLmanaGer",
3-
"version": "2.1.0",
3+
"version": "2.1.1",
44
"manifest_version": 2,
55
"description": "Desarrollamiento tool",
66
"homepage_url": "https://github.com/joelthorner/TLmanaGer",

0 commit comments

Comments
 (0)