From a489a0a3018499282824ae3124484dd6ab40710e Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Thu, 19 Dec 2019 15:35:11 +0100 Subject: Allow running Homer in a subdirectory When running homer in a subpath the worker cannot be loaded (404) the same accounts for the images in the default configuration. Signed-off-by: Felix Bartels --- app.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index def0be7..40830da 100644 --- a/app.js +++ b/app.js @@ -9,14 +9,14 @@ const app = new Vue({ }, created: function () { let that = this; - - this.isDark = 'overrideDark' in localStorage ? + + this.isDark = 'overrideDark' in localStorage ? JSON.parse(localStorage.overrideDark) : matchMedia("(prefers-color-scheme: dark)").matches; if ('vlayout' in localStorage) { this.vlayout = JSON.parse(localStorage.vlayout) } - + this.checkOffline(); that.getConfig().then(function (config) { that.config = config; @@ -58,8 +58,8 @@ const app = new Vue({ }, toggleLayout: function() { this.vlayout = !this.vlayout; - localStorage.vlayout = this.vlayout; - }, + localStorage.vlayout = this.vlayout; + }, } }); @@ -95,6 +95,6 @@ Vue.component('service', { if ('serviceWorker' in navigator) { window.addEventListener('load', function () { - navigator.serviceWorker.register('/worker.js'); + navigator.serviceWorker.register('worker.js'); }); } -- cgit v1.2.3