Merge pull request #539 from ueokande/webext-on-install-event
Use browser.runtime.onInstalled eventjh-changes
commit
cebd64a69f
5 changed files with 30 additions and 26 deletions
@ -0,0 +1,13 @@ |
|||||||
|
import VersionInteractor from '../usecases/version'; |
||||||
|
|
||||||
|
export default class VersionController { |
||||||
|
constructor() { |
||||||
|
this.versionInteractor = new VersionInteractor(); |
||||||
|
} |
||||||
|
|
||||||
|
notifyIfUpdated() { |
||||||
|
browser.runtime.onInstalled.addListener(() => { |
||||||
|
return this.versionInteractor.notify(); |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
@ -1,6 +1,6 @@ |
|||||||
const NOTIFICATION_ID = 'vimvixen-update'; |
const NOTIFICATION_ID = 'vimvixen-update'; |
||||||
|
|
||||||
export default class Notifier { |
export default class NotifyPresenter { |
||||||
notify(title, message, onclick) { |
notify(title, message, onclick) { |
||||||
const listener = (id) => { |
const listener = (id) => { |
||||||
if (id !== NOTIFICATION_ID) { |
if (id !== NOTIFICATION_ID) { |
Reference in new issue