Refactor
This commit is contained in:
parent
6f5f233bb5
commit
1cd3419688
1 changed files with 5 additions and 5 deletions
|
@ -42,9 +42,9 @@ export default class MiOS extends EventEmitter {
|
||||||
* @param callback A function that call when initialized
|
* @param callback A function that call when initialized
|
||||||
*/
|
*/
|
||||||
@autobind
|
@autobind
|
||||||
public async init(_callback) {
|
public async init(callback) {
|
||||||
const callback = () => {
|
const finish = () => {
|
||||||
_callback();
|
callback();
|
||||||
|
|
||||||
this.store.dispatch('instance/fetch').then(() => {
|
this.store.dispatch('instance/fetch').then(() => {
|
||||||
// Init service worker
|
// Init service worker
|
||||||
|
@ -104,7 +104,7 @@ export default class MiOS extends EventEmitter {
|
||||||
this.initStream();
|
this.initStream();
|
||||||
|
|
||||||
// Finish init
|
// Finish init
|
||||||
callback();
|
finish();
|
||||||
};
|
};
|
||||||
|
|
||||||
// キャッシュがあったとき
|
// キャッシュがあったとき
|
||||||
|
@ -133,7 +133,7 @@ export default class MiOS extends EventEmitter {
|
||||||
this.initStream();
|
this.initStream();
|
||||||
|
|
||||||
// Finish init
|
// Finish init
|
||||||
callback();
|
finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue