diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-07-13 22:30:05 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 22:30:05 +0900 |
commit | 28bfa3ac8124d3453cd539db26da4f4703e783df (patch) | |
tree | dd4461af8343a7d5c9fc13cc51cd0fd5edd0285e /src/shared/versions/index.js | |
parent | 37840c2abb02948d36cdcfaab9063f3ea67fdb6b (diff) | |
parent | 803e6ea7af60107182356b5fda8e3c2ddfacaefa (diff) |
Merge pull request #431 from ueokande/command-completions
Command completions
Diffstat (limited to 'src/shared/versions/index.js')
-rw-r--r-- | src/shared/versions/index.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/shared/versions/index.js b/src/shared/versions/index.js deleted file mode 100644 index ba3d183..0000000 --- a/src/shared/versions/index.js +++ /dev/null @@ -1,38 +0,0 @@ -import * as storage from './storage'; -import * as releaseNotes from './release-notes'; -import manifest from '../../../manifest.json'; - -const NOTIFICATION_ID = 'vimvixen-update'; - -const notificationClickListener = (id) => { - if (id !== NOTIFICATION_ID) { - return; - } - - browser.tabs.create({ url: releaseNotes.url(manifest.version) }); - browser.notifications.onClicked.removeListener(notificationClickListener); -}; - -const checkUpdated = async() => { - let prev = await storage.load(); - if (!prev) { - return true; - } - return manifest.version !== prev; -}; - -const notify = () => { - browser.notifications.onClicked.addListener(notificationClickListener); - return browser.notifications.create(NOTIFICATION_ID, { - 'type': 'basic', - 'iconUrl': browser.extension.getURL('resources/icon_48x48.png'), - 'title': 'Vim Vixen ' + manifest.version + ' has been installed', - 'message': 'Click here to see release notes', - }); -}; - -const commit = () => { - storage.save(manifest.version); -}; - -export { checkUpdated, notify, commit }; |