Skip to content

Commit

Permalink
fix: yield page loading state
Browse files Browse the repository at this point in the history
  • Loading branch information
k0beLeenders committed Dec 17, 2024
1 parent 1c74552 commit a6fcf16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/marginfi-v2-trading/src/pages/yield.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const getStaticProps: GetStaticProps<StaticArenaProps> = async (context)
};

export default function YieldPage({ initialData }: StaticArenaProps) {
const [initialized, sortBy, setSortBy, fetchArenaGroups, setHydrationComplete] = useTradeStoreV2((state) => [
state.initialized,
const [poolsFetched, sortBy, setSortBy, fetchArenaGroups, setHydrationComplete] = useTradeStoreV2((state) => [
state.poolsFetched,
state.sortBy,
state.setSortBy,
state.fetchArenaGroups,
Expand Down Expand Up @@ -145,8 +145,8 @@ export default function YieldPage({ initialData }: StaticArenaProps) {
return (
<>
<div className="w-full max-w-8xl mx-auto px-4 md:px-8 pb-28 pt-12 min-h-[calc(100vh-100px)]">
{!initialized && <Loader label="Loading yield farming..." className="mt-8" />}
{initialized && (
{!poolsFetched && <Loader label="Loading yield farming..." className="mt-8" />}
{poolsFetched && (
<>
<div className="w-full max-w-4xl mx-auto">
<PageHeading
Expand Down Expand Up @@ -269,7 +269,7 @@ export default function YieldPage({ initialData }: StaticArenaProps) {
)}
</div>

{initialized && previousTxn && (
{poolsFetched && previousTxn && (
<ActionComplete
isActionComplete={isActionComplete}
setIsActionComplete={setIsActionComplete}
Expand Down

0 comments on commit a6fcf16

Please sign in to comment.