Skip to content

Commit

Permalink
fix project not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Rb3 committed May 9, 2024
1 parent 9d4dfee commit 7967098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/pages/Profile/components/Body/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Container, Details, ModalTitle, Row, Wrapper } from "./styles";
// };

const Body = (props: any) => {
const { projectId } = props;
const { projectId, registration } = props;
const { accountId: _accountId } = useParams();
const accountId = _accountId ?? context.accountId;
const {
Expand All @@ -31,7 +31,6 @@ const Body = (props: any) => {

const listsContractId = ListsSDK.getContractId();
const userIsRegistryAdmin = ListsSDK.isRegistryAdmin(context.accountId);
const registration = ListsSDK.getRegistration(null, projectId);

const handleUpdateStatus = () => {
Near.call([
Expand Down
5 changes: 1 addition & 4 deletions src/pages/Project/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import DonateSDK from "@app/SDK/donate";
import ListsSDK from "@app/SDK/lists";
import PotSDK from "@app/SDK/pot";
import PotFactorySDK from "../../SDK/potfactory";
import getProjectByProjectId from "../../services/getProjectByProjectId";
import Body from "../Profile/components/Body/Body";
import BannerSkeleton from "./components/BannerSkeleton";
import ProjectBanner from "./components/ProjectBanner/ProjectBanner";
Expand All @@ -13,13 +12,12 @@ import ProjectOptions from "./utils/ProjectOptions";
const ProjectPage = () => {
const { projectId, nav } = useParams();
const accountId = context.accountId;
const project = getProjectByProjectId(projectId);
const pots = PotFactorySDK.getPots();
const profile = Social.getr(`${projectId}/profile`);
const registration = ListsSDK.getRegistration(null, projectId);
const account = fetch("https://api3.nearblocks.io/v1/account/" + projectId);

const isReady = !!project && !!pots && !!profile && !!registration && !!account;
const isReady = pots !== null && profile !== null && registration !== null;

if (!isReady) return <BannerSkeleton />;

Expand Down Expand Up @@ -113,7 +111,6 @@ const ProjectPage = () => {

<Body
{...{
project,
profile,
registration,
projectId,
Expand Down

0 comments on commit 7967098

Please sign in to comment.