mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-22 12:13:48 +01:00
This commit is contained in:
parent
52a2aadc10
commit
2b9d5edc85
@ -52,9 +52,20 @@ export default class MiOS extends EventEmitter {
|
||||
*/
|
||||
private swRegistration: ServiceWorkerRegistration = null;
|
||||
|
||||
constructor() {
|
||||
/**
|
||||
* Whether should register ServiceWorker
|
||||
*/
|
||||
private shouldRegisterSw: boolean;
|
||||
|
||||
/**
|
||||
* MiOSインスタンスを作成します
|
||||
* @param shouldRegisterSw ServiceWorkerを登録するかどうか
|
||||
*/
|
||||
constructor(shouldRegisterSw = false) {
|
||||
super();
|
||||
|
||||
this.shouldRegisterSw = shouldRegisterSw;
|
||||
|
||||
//#region BIND
|
||||
this.log = this.log.bind(this);
|
||||
this.logInfo = this.logInfo.bind(this);
|
||||
@ -170,7 +181,7 @@ export default class MiOS extends EventEmitter {
|
||||
//#region Post
|
||||
|
||||
// Init service worker
|
||||
this.registerSw();
|
||||
if (this.shouldRegisterSw) this.registerSw();
|
||||
|
||||
//#endregion
|
||||
};
|
||||
|
@ -40,7 +40,7 @@ init(async (mios: MiOS) => {
|
||||
|
||||
// Start routing
|
||||
route(mios);
|
||||
});
|
||||
}, true);
|
||||
|
||||
function registerNotifications(stream: HomeStreamManager) {
|
||||
if (stream == null) return;
|
||||
|
@ -52,8 +52,8 @@ if (localStorage.getItem('should-refresh') == 'true') {
|
||||
}
|
||||
|
||||
// MiOSを初期化してコールバックする
|
||||
export default callback => {
|
||||
const mios = new MiOS();
|
||||
export default (callback, sw = false) => {
|
||||
const mios = new MiOS(sw);
|
||||
|
||||
mios.init(() => {
|
||||
// ミックスイン初期化
|
||||
|
@ -19,4 +19,4 @@ init((mios: MiOS) => {
|
||||
|
||||
// Start routing
|
||||
route(mios);
|
||||
});
|
||||
}, true);
|
||||
|
Loading…
Reference in New Issue
Block a user