From d77010ad411fede0b149eacf70f2e75d41fe0747 Mon Sep 17 00:00:00 2001 From: Rune Harlyk Date: Thu, 22 Aug 2024 21:14:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=B9=20Adds=20a=20persistentStore=20for?= =?UTF-8?q?=20location?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/lib/stores/index.ts | 1 + app/src/lib/stores/location-store.ts | 3 +++ app/src/lib/utilities/index.ts | 1 - app/src/lib/utilities/location-utilities.ts | 9 --------- 4 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 app/src/lib/stores/location-store.ts delete mode 100644 app/src/lib/utilities/location-utilities.ts diff --git a/app/src/lib/stores/index.ts b/app/src/lib/stores/index.ts index b92ae27..ad2e51a 100644 --- a/app/src/lib/stores/index.ts +++ b/app/src/lib/stores/index.ts @@ -7,3 +7,4 @@ export * from './telemetry'; export * from './analytics'; export * from './user'; export * from './featureFlags'; +export * from './location-store'; diff --git a/app/src/lib/stores/location-store.ts b/app/src/lib/stores/location-store.ts new file mode 100644 index 0000000..1e4d4d8 --- /dev/null +++ b/app/src/lib/stores/location-store.ts @@ -0,0 +1,3 @@ +import { persistentStore } from '$lib/utilities'; + +export const location = persistentStore('location', '/'); diff --git a/app/src/lib/utilities/index.ts b/app/src/lib/utilities/index.ts index 6a850f5..acbf139 100644 --- a/app/src/lib/utilities/index.ts +++ b/app/src/lib/utilities/index.ts @@ -4,7 +4,6 @@ export * from './svelte-utilities'; export * from './math-utilities'; export * from './buffer-utilities'; export * from './model-utilities'; -export * from './location-utilities'; export * from './position-utilities'; export * from './string-utilities'; export * from './color-utilities'; diff --git a/app/src/lib/utilities/location-utilities.ts b/app/src/lib/utilities/location-utilities.ts deleted file mode 100644 index 0ba138a..0000000 --- a/app/src/lib/utilities/location-utilities.ts +++ /dev/null @@ -1,9 +0,0 @@ -export const hostname = 'localhost'; //window.location.hostname; - -export const isSecure = true; // window.location.protocol === 'https:'; - -export const location = 'localhost:5173'; //window.location; //import.meta.env.VITE_API_URL.replace('hostname', hostname); - -const socketScheme = isSecure ? 'wss://' : 'ws://'; - -export const socketLocation = socketScheme + location; // import.meta.env.VITE_SOCKET_URL.replace('hostname', hostname);