Skip to content

Commit

Permalink
fix flicker when navigating from login
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Nov 15, 2024
1 parent 0b5bba2 commit a6da58d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion apps/desktop/src/routes/(window-chrome).tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions apps/desktop/src/routes/(window-chrome)/(main).tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

1 comment on commit a6da58d

@vercel
Copy link

@vercel vercel bot commented on a6da58d Nov 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.