Skip to content

Commit

Permalink
[#220] fix drep list infinite loader for unnconnected users
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dyczka committed Mar 27, 2024
1 parent ec64235 commit 7d609d9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion govtool/frontend/src/pages/DRepDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const DRepDetails = ({ isConnected }: DRepDetailsProps) => {
const { data, isLoading } = useGetDRepListQuery(dRepParam);
const dRep = data?.[0];

if (!dRep && isLoading) return <CircularProgress />;
if (!dRep && isLoading) return <CircularProgress sx={{ display: 'block', mx: 'auto', mt: 4 }} />;

if (!dRep) return <Navigate to={PATHS.error} />;

Expand Down
3 changes: 1 addition & 2 deletions govtool/frontend/src/pages/DRepDirectoryContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
}) => {
const {
dRepID: myDRepId,
isEnabled,
pendingTransaction,
stakeKey,
} = useCardano();
Expand All @@ -40,7 +39,7 @@ export const DRepDirectoryContent: FC<DRepDirectoryContentProps> = ({
const myDrep = myDRepList?.[0];
const { data: dRepList } = useGetDRepListQuery();

if (!isEnabled || votingPower === undefined || !dRepList) {
if ((stakeKey && votingPower === undefined) || !dRepList) {
return <CircularProgress sx={{ display: 'block', mx: 'auto', mt: 4 }} />;
}

Expand Down

0 comments on commit 7d609d9

Please sign in to comment.