Skip to content

Commit

Permalink
style: apply prettier, fix lint errors and escape HTML special char
Browse files Browse the repository at this point in the history
  • Loading branch information
uooooo committed Sep 14, 2024
1 parent 7b345b8 commit 06cb58b
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions apps/dashboard/src/pages/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,30 +246,30 @@ ${memberIds.join("\n")}
}

const handleDownload = async () => {
if (!_group) return;
if (!_group) return

try {
const response = await bandadaApi.getGroup(_group.id);
const response = await bandadaApi.getGroup(_group.id)
if (response) {
const json = JSON.stringify(response, null, 2);
const blob = new Blob([json], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = `${_group.name}.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
const json = JSON.stringify(response, null, 2)
const blob = new Blob([json], { type: "application/json" })
const url = URL.createObjectURL(blob)
const a = document.createElement("a")
a.href = url
a.download = `${_group.name}.json`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
} catch (error) {
console.error("Failed to download group data:", error);
console.error("Failed to download group data:", error)
toast({
title: "Error",
description: "Failed to download group data.",
status: "error",
duration: 3000
});
})
}
}
let credentialsId = ""
Expand Down Expand Up @@ -514,21 +514,21 @@ ${memberIds.join("\n")}
p="25px 30px 25px 30px"
borderRadius="8px"
>
<Text fontSize="20px">Download group</Text>
<Flex align="center" mt="2">
<Text my="10px" fontWeight="400">
Get the group's data in JSON format.
</Text>
<Spacer />
<Button
variant="solid"
colorScheme="tertiary"
onClick={handleDownload}
>
Download
</Button>
</Flex>
</Box>
<Text fontSize="20px">Download group</Text>
<Flex align="center" mt="2">
<Text my="10px" fontWeight="400">
Get the group&apos; data JSON format.
</Text>
<Spacer />
<Button
variant="solid"
colorScheme="tertiary"
onClick={handleDownload}
>
Download
</Button>
</Flex>
</Box>
)}
{/* {groupType === "off-chain" &&
!_group.credentials &&
Expand Down

0 comments on commit 06cb58b

Please sign in to comment.