From 30eb573f5c38649f4d2d8fe6188830485b8ab18a Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 20 Dec 2018 04:11:10 +0900 Subject: [PATCH] Fix #3683 --- src/models/meta.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/models/meta.ts b/src/models/meta.ts index b40fabdfc..fd07438a8 100644 --- a/src/models/meta.ts +++ b/src/models/meta.ts @@ -138,6 +138,19 @@ if ((config as any).user_recommendation) { } }); } +if ((config as any).sw) { + Meta.findOne({}).then(m => { + if (m != null && m.enableServiceWorker == null) { + Meta.update({}, { + $set: { + enableServiceWorker: true, + swPublicKey: (config as any).sw.public_key, + swPrivateKey: (config as any).sw.private_key + } + }); + } + }); +} export type IMeta = { name?: string;