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;