Skip to content

Commit

Permalink
Merge pull request #816 from near/develop
Browse files Browse the repository at this point in the history
weekly promotion of develop to main
  • Loading branch information
charleslavon authored May 21, 2024
2 parents 6f8cbfe + 8170ea1 commit 4e8242f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/DIG/OverviewPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const ContentGrid = styled.div`
`;

return (
<Wrapper>
<Wrapper className="gateway-page-container">
<Container>
<Text size="text-3xl">DIG Components</Text>

Expand Down
8 changes: 6 additions & 2 deletions src/Entities/QueryApi/DataPlatformIndexerStatuses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ const registry = Near.view(registryContract, "list_indexer_functions", {
account_id: indexerAccount,
});

if (errors && (!registry || !indexerList)) {
return <div>{errors ? JSON.stringify(errors) : null}</div>;
}

if (!registry) {
return <div>Loading indexer list from contract...</div>;
} else {
try {
const keys = Object.keys(registry["Account"]);
const keys = Object.keys(registry["AccountIndexers"]);
const sanitizedIndexerNames = keys.map((k) => k.replace(/[^a-zA-Z0-9]/g, "_").replace(/^([0-9])/, "_$1"));

setIndexerList(sanitizedIndexerNames);
Expand Down Expand Up @@ -117,7 +121,7 @@ const update = () => {
}
};

if (!timer) {
if (registry && !timer) {
update();
setTimer(setInterval(update, 1000));
}
Expand Down
20 changes: 11 additions & 9 deletions src/Posts/RepostButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,16 @@ const buildMenu = (accountId, blockHeight) => {

return (
<>
<Widget
src="${REPL_ACCOUNT}/widget/DIG.DropdownMenu"
props={{
trigger: <Button type="button" title="Repost" aria-label="Repost" onClick={repostClick}>
{!hasRepostByUser ? <i className="bi-repeat" /> : <i className="bi bi-pencil" />}
</Button>,
items: buildMenu(accountId, blockHeight),
}}
/>
<Widget
src="${REPL_ACCOUNT}/widget/DIG.DropdownMenu"
props={{
trigger: (
<Button type="button" title="Repost" aria-label="Repost" onClick={repostClick}>
{!hasRepostByUser ? <i className="bi-repeat" /> : <i className="bi bi-pencil" />}
</Button>
),
items: buildMenu(accountId, blockHeight),
}}
/>
</>
);

0 comments on commit 4e8242f

Please sign in to comment.