This repository has been archived on 2025-11-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
trafficcue-client/src/main.ts
Jannik 243d5c6437
Some checks failed
TrafficCue CI / build (push) Has been cancelled
TrafficCue CI / build-android (push) Has been cancelled
TrafficCue CI / check (push) Has been cancelled
feat(stores): sync automatically
2025-09-27 19:46:37 +02:00

29 lines
555 B
TypeScript

import { mount } from "svelte";
import "./app.css";
import App from "./App.svelte";
import { trySync } from "$lib/services/stores.svelte";
if (location.href.includes("/oidc")) {
const url = new URL(location.href);
const code = url.searchParams.get("code");
const state = url.searchParams.get("state");
if (code && state) {
window.opener.postMessage(
{
code,
state,
},
window.location.origin,
);
window.close();
}
}
const app = mount(App, {
target: document.getElementById("app")!,
});
await trySync();
export default app;