Use onInstalled event

This commit is contained in:
Shin'ya Ueoka 2019-02-15 21:01:12 +09:00
parent dfeb7e7549
commit f961c205a7
5 changed files with 27 additions and 26 deletions

View file

@ -5,7 +5,7 @@ export default class VersionController {
this.versionUseCase = new VersionUseCase();
}
notifyIfUpdated() {
this.versionUseCase.notifyIfUpdated();
notify() {
this.versionUseCase.notify();
}
}

View file

@ -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();
});
}
}