From 7524d202f70a93c7a763ec17f8ca599e6e596f02 Mon Sep 17 00:00:00 2001 From: wukko Date: Mon, 26 Aug 2024 23:38:24 +0600 Subject: [PATCH] web/session: merge cached state into main lib --- web/src/lib/api/session.ts | 8 ++++---- web/src/lib/state/session.ts | 4 ---- 2 files changed, 4 insertions(+), 8 deletions(-) delete mode 100644 web/src/lib/state/session.ts diff --git a/web/src/lib/api/session.ts b/web/src/lib/api/session.ts index c6413fae..f7974393 100644 --- a/web/src/lib/api/session.ts +++ b/web/src/lib/api/session.ts @@ -1,10 +1,10 @@ -import { get } from "svelte/store"; - import turnstile from "$lib/api/turnstile"; +import { writable, get } from "svelte/store"; import { currentApiURL } from "$lib/api/api-url"; -import { cachedSession } from "$lib/state/session"; -import type { CobaltSessionResponse, CobaltErrorResponse } from "$lib/types/api"; +import type { CobaltSession, CobaltErrorResponse, CobaltSessionResponse } from "$lib/types/api"; + +const cachedSession = writable(); export const requestSession = async() => { const apiEndpoint = `${currentApiURL()}/session`; diff --git a/web/src/lib/state/session.ts b/web/src/lib/state/session.ts deleted file mode 100644 index d895fb01..00000000 --- a/web/src/lib/state/session.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { writable } from "svelte/store"; -import type { CobaltSession } from "$lib/types/api"; - -export const cachedSession = writable();