From 3396d173586a6bb9518d07e4f9d84b6ba0bcf4b9 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 2 Jan 2021 22:23:32 +0100 Subject: [PATCH] hash based routing in env file ref #23 --- env.sample.js | 3 ++- public/env.sample.js | 3 ++- src/App.svelte | 5 +++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/env.sample.js b/env.sample.js index 6e67035f..56fde078 100644 --- a/env.sample.js +++ b/env.sample.js @@ -1,5 +1,6 @@ const config = { baseurl: 'https://dev.lauf-fuer-kaya.de', fallback_username: 'admin', - fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3' + fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3', + prefersHashRouting: true }; diff --git a/public/env.sample.js b/public/env.sample.js index f5031633..da304301 100644 --- a/public/env.sample.js +++ b/public/env.sample.js @@ -2,5 +2,6 @@ const config = { baseurl: 'http://localhost:4010', // optional params ⏬ fallback_username: 'demo', - fallback_password: 'demo' + fallback_password: 'demo', + prefersHashRouting: true }; diff --git a/src/App.svelte b/src/App.svelte index 914b0df5..fff32447 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -7,6 +7,11 @@ }); console.log($router.path); console.log(config); + if (config.prefersHashRouting) { + if (config.prefersHashRouting === true) { + router.useHashNavigation(); + } + } import localForage from "localforage"; import { addMessages, init, getLocaleFromNavigator } from "svelte-i18n"; import en from "./locales/en.json";