Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix flicker when navigating from login

Brendan Allana6da58d15094
diff --git a/apps/desktop/src/routes/(window-chrome).tsx b/apps/desktop/src/routes/(window-chrome).tsx
index fd700f5a9..626b481e6 100644
--- a/apps/desktop/src/routes/(window-chrome).tsx
+++ b/apps/desktop/src/routes/(window-chrome).tsx
@@ -46,7 +46,10 @@ export default function (props: RouteSectionProps) {
exitToClass="opacity-0"
> */}
<Suspense fallback={<AbsoluteInsetLoader />}>
- <Inner>{props.children}</Inner>
+ <Inner>
+ {/* prevents flicker idk */}
+ <Suspense>{props.children}</Suspense>
+ </Inner>
</Suspense>
{/* </Transition> */}
</div>
diff --git a/apps/desktop/src/routes/(window-chrome)/(main).tsx b/apps/desktop/src/routes/(window-chrome)/(main).tsx
index ed128d0c7..1775e776a 100644
--- a/apps/desktop/src/routes/(window-chrome)/(main).tsx
+++ b/apps/desktop/src/routes/(window-chrome)/(main).tsx
@@ -48,12 +48,12 @@ import {
const getAuth = cache(async () => {
const value = await authStore.get();
- if (!value && !import.meta.env.TAURI_ENV_DEBUG) return redirect("/signin");
+ const local = import.meta.env.VITE_LOCAL_MODE === "true";
+ if (!value && !local) return redirect("/signin");
const res = await fetch(`${clientEnv.VITE_SERVER_URL}/api/desktop/plan`, {
headers: { authorization: `Bearer ${value?.token}` },
});
- if (res.status !== 200 && !import.meta.env.TAURI_ENV_DEBUG)
- return redirect("/signin");
+ if (res.status !== 200 && !local) return redirect("/signin");
return value;
}, "getAuth");
diff --git a/turbo.json b/turbo.json
index 0e581d33f..0790655d5 100644
--- a/turbo.json
+++ b/turbo.json
@@ -4,7 +4,7 @@
"globalDotEnv": [".env"],
"pipeline": {
"build": {
- "inputs": ["**/*.ts", "!src-tauri/**", "!node_modules/**"],
+ "inputs": ["**/*.ts", "**/*.tsx", "!src-tauri/**", "!node_modules/**"],
"dependsOn": ["^build"],
"outputs": [".next/**", "!.next/cache/**"],
"dotEnv": [