summaryrefslogtreecommitdiff
path: root/src/web/app/common
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-11-21 10:01:00 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-11-21 10:01:00 +0900
commitc47addc973af1a685dfa39ed1e484df85a02e306 (patch)
tree91d1f1bd19ca01194acf5223b34e4b430ac5bb54 /src/web/app/common
parentv3177 (diff)
downloadmisskey-c47addc973af1a685dfa39ed1e484df85a02e306.tar.gz
misskey-c47addc973af1a685dfa39ed1e484df85a02e306.tar.bz2
misskey-c47addc973af1a685dfa39ed1e484df85a02e306.zip
#934
Diffstat (limited to 'src/web/app/common')
-rw-r--r--src/web/app/common/mios.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/web/app/common/mios.ts b/src/web/app/common/mios.ts
index cf7841d848..838be9c370 100644
--- a/src/web/app/common/mios.ts
+++ b/src/web/app/common/mios.ts
@@ -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
};