mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 11:23:10 +02:00
Various bug fixes found while testing SaaS build (#6459)
# Description of Changes Various fixes and improvements I made while testing the SaaS code: - Changes the new `.env.saas` file to live in `app/` and match the semantics of the other `.env` files - Adds top-level `task dev:saas` command to spawn SaaS frontend & backend - Deletes dead SaaS code and improves some overriding logic - Fixes refreshing issue when coming back to the tab - Fix the Compare tool's selection logic - Make Compare handle error cases properly - Fixes the location of the "Dismiss All Errors" button (was rendering on top of the top-bar with a transparent background previously so it looked rubbish) - Fixes file selection in PDF Editor
This commit is contained in:
@@ -550,7 +550,14 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
} else if (event === "SIGNED_IN") {
|
||||
console.debug("[Auth Debug] User signed in successfully");
|
||||
if (newSession?.user) {
|
||||
setLoading(true);
|
||||
// Note: we deliberately do NOT toggle `loading` here. Supabase
|
||||
// also fires SIGNED_IN on tab visibility / token-refresh wakeups
|
||||
// (per its docs: "SIGNED_IN is fired when a user signs in OR
|
||||
// when the access token is refreshed"), and gating the UI on
|
||||
// `loading` would unmount Landing -> HomePage every time the
|
||||
// user switches tabs back. Initial-mount loading is handled by
|
||||
// `initializeAuth` above; downstream fetches expose their own
|
||||
// null/loading states.
|
||||
|
||||
// Sync OAuth avatar in background (don't block other fetches)
|
||||
syncOAuthAvatar(newSession.user).catch((err) => {
|
||||
@@ -568,7 +575,6 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
// Use a small delay to allow avatar sync to finish if it's quick
|
||||
setTimeout(() => {
|
||||
fetchProfilePicture(newSession).finally(() => {
|
||||
setLoading(false);
|
||||
console.debug(
|
||||
"[Auth Debug] User data fully loaded after sign in",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user