Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
focus app after auth complete
Brendan Allane4c49d35fca8
diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsxindex 293ff607f..93312dc60 100644--- a/apps/desktop/src/App.tsx+++ b/apps/desktop/src/App.tsx@@ -11,12 +11,16 @@ const queryClient = new QueryClient();export default function App() {return (<ErrorBoundary- fallback={(e: Error) => (- <>- <p>{e.toString()}</p>- <p>{e.stack?.toString()}</p>- </>- )}+ fallback={(e: Error) => {+ console.log("An error was caught by the root error boundary");+ console.log(e);+ return (+ <>+ <p>{e.toString()}</p>+ <p>{e.stack?.toString()}</p>+ </>+ );+ }}><QueryClientProvider client={queryClient}><Routerdiff --git a/apps/desktop/src/routes/(main)/signin.tsx b/apps/desktop/src/routes/(main)/signin.tsxindex 0796810e8..861d63be9 100644--- a/apps/desktop/src/routes/(main)/signin.tsx+++ b/apps/desktop/src/routes/(main)/signin.tsx@@ -6,6 +6,8 @@ import { action, redirect, useAction, useSubmission } from "@solidjs/router";import callbackTemplate from "./callback.template";import { authStore } from "../../store";+import { clientEnv } from "../../utils/env";+import { getCurrentWindow } from "@tauri-apps/api/window";const signInAction = action(async () => {let res: (url: URL) => void;@@ -28,9 +30,7 @@ const signInAction = action(async () => {});await shell.open(- `${- import.meta.env.VITE_SERVER_URL- }/api/desktop/session/request?port=${port}`+ `${clientEnv.VITE_SERVER_URL}/api/desktop/session/request?port=${port}`);const url = await new Promise<URL>((r) => {@@ -46,6 +46,10 @@ const signInAction = action(async () => {await authStore.set({ token, expires });+ getCurrentWindow()+ .setFocus()+ .catch(() => {});+return redirect("/");});diff --git a/apps/desktop/src/utils/env.ts b/apps/desktop/src/utils/env.tsnew file mode 100644index 000000000..b0aac63b6--- /dev/null+++ b/apps/desktop/src/utils/env.ts@@ -0,0 +1,3 @@+export const clientEnv = {+ VITE_SERVER_URL: import.meta.env.VITE_SERVER_URL ?? "https://cap.so",+};