Skip to content

Commit

Permalink
Merge pull request #921 from tablelandnetwork/datadanne/refresh-admin…
Browse files Browse the repository at this point in the history
…-data-after-creating-new-entry

Garage: refresh admin data after creating new entry
  • Loading branch information
datadanne authored Sep 21, 2023
2 parents df1bf43 + 2738b28 commit ddae5be
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions garage/src/pages/Admin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,18 @@ const GiveFtRewardForm = (props: React.ComponentProps<typeof Box>) => {
};

const ListProposalsForm = (props: React.ComponentProps<typeof Box>) => {
const { proposals } = useProposals();
const { proposals, refresh } = useProposals();

const [proposalDialogOpen, setCreateProposalDialogOpen] = useState(false);

return (
<>
<CreateProposalModal
isOpen={proposalDialogOpen}
onClose={() => setCreateProposalDialogOpen(false)}
onClose={() => {
refresh();
setCreateProposalDialogOpen(false);
}}
/>
<Box {...props}>
<HStack
Expand Down Expand Up @@ -224,15 +227,18 @@ const ListProposalsForm = (props: React.ComponentProps<typeof Box>) => {
};

const ListMissionsForm = (props: React.ComponentProps<typeof Box>) => {
const { missions } = useAdminMisisons();
const { missions, refresh } = useAdminMisisons();

const [missionDialogOpen, setMissionDialogOpen] = useState(false);

return (
<>
<CreateMissionModal
isOpen={missionDialogOpen}
onClose={() => setMissionDialogOpen(false)}
onClose={() => {
refresh();
setMissionDialogOpen(false);
}}
/>
<Box {...props}>
<HStack
Expand Down

0 comments on commit ddae5be

Please sign in to comment.