From b5fd3656a74c85619f5b194c7e11d5ba888fd065 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Sun, 12 Jun 2022 16:51:10 +0530 Subject: [PATCH] Fix code breaking on dev server --- src/platform/web/Platform.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/platform/web/Platform.js b/src/platform/web/Platform.js index b0ed55da..dfb26b0f 100644 --- a/src/platform/web/Platform.js +++ b/src/platform/web/Platform.js @@ -187,11 +187,13 @@ export class Platform { this._serviceWorkerHandler, this._config.push ); - const manifests = this.config["themeManifests"]; - await this._themeLoader?.init(manifests, log); - const { themeName, themeVariant } = await this._themeLoader.getActiveTheme(); - log.log({ l: "Active theme", name: themeName, variant: themeVariant }); - this._themeLoader?.setTheme(themeName, themeVariant, log); + if (this._themeLoader) { + const manifests = this.config["themeManifests"]; + await this._themeLoader?.init(manifests, log); + const { themeName, themeVariant } = await this._themeLoader.getActiveTheme(); + log.log({ l: "Active theme", name: themeName, variant: themeVariant }); + this._themeLoader.setTheme(themeName, themeVariant, log); + } }); } catch (err) { this._container.innerText = err.message;