Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 28 additions & 31 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ function App() {
const setOrgInfoToStore = useGlobalStore((state) => state.setOrgInfo);
const { refetch } = useQuery(
["organization"],
() =>
Organization.get().then((res) => res[0]),
() => Organization.get().then((res) => res[0]),
{
onSuccess: (data) => {
const storeOrgObject: IOrgStoreType = {
Expand Down Expand Up @@ -71,16 +70,15 @@ function App() {
isAuthenticated: boolean;
}>(["session"], fetchSessionInfo, { refetchInterval: 60000 });

const isAuthenticated = isLoading ? false : sessionData?.isAuthenticated;
const isAuthenticated =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

good catch

isLoading && !sessionData ? false : sessionData?.isAuthenticated;

const contextClass = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

was this deleted because it wasn't being used anywhere @glamboyosa

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yah. has not been used in a long time.

success: "bg-[#cca43b] text-[#cca43b]",
};
useEffect(() => {
if (isAuthenticated) {
refetch();
}
}, [isAuthenticated]);

if (isLoading) {
return (
<div className="flex h-screen">
Expand All @@ -90,32 +88,31 @@ function App() {
</div>
);
}
if (isAuthenticated) {
return (
<div>
<ToastContainer
autoClose={3000}
bodyClassName=" text-gold font-main"
position="top-center"
/>
<PlanProvider>
<AppRoutes />
</PlanProvider>
</div>
);
}
return (
<div>
<ToastContainer
autoClose={3000}
toastClassName="rounded-md bg-background font-main"
bodyClassName=" text-gold font-main"
/>
<ExternalRoutes />
</div>
);


if (isAuthenticated) {
return (
<div>
<ToastContainer
autoClose={3000}
bodyClassName=" text-gold font-main"
position="top-center"
/>
<PlanProvider>
<AppRoutes />
</PlanProvider>
</div>
);
}
return (
<div>
<ToastContainer
autoClose={3000}
toastClassName="rounded-md bg-background font-main"
bodyClassName=" text-gold font-main"
/>
<ExternalRoutes />
</div>
);
}

export default App;