web/session: merge cached state into main lib
This commit is contained in:
parent
59308ed09f
commit
7524d202f7
2 changed files with 4 additions and 8 deletions
|
@ -1,10 +1,10 @@
|
||||||
import { get } from "svelte/store";
|
|
||||||
|
|
||||||
import turnstile from "$lib/api/turnstile";
|
import turnstile from "$lib/api/turnstile";
|
||||||
|
import { writable, get } from "svelte/store";
|
||||||
import { currentApiURL } from "$lib/api/api-url";
|
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<CobaltSession | undefined>();
|
||||||
|
|
||||||
export const requestSession = async() => {
|
export const requestSession = async() => {
|
||||||
const apiEndpoint = `${currentApiURL()}/session`;
|
const apiEndpoint = `${currentApiURL()}/session`;
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
import { writable } from "svelte/store";
|
|
||||||
import type { CobaltSession } from "$lib/types/api";
|
|
||||||
|
|
||||||
export const cachedSession = writable<CobaltSession | undefined>();
|
|
Loading…
Reference in a new issue