Skip to content

Commit

Permalink
Update Sui.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Jul 19, 2024
1 parent 34abff6 commit 58b8d44
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/component/chains/Sui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const Sui = () => {
const account = useCurrentAccount();
const [state] = useRecoilState(STATE);
const [disabled, setDisabled] = useState<boolean>(false);
const [title, setTitle] = useState<string>('Sign');

const handleSign = async () => {
if (state && account) {
Expand All @@ -46,6 +47,7 @@ export const Sui = () => {
const transaction = new Transaction();
transaction.transferObjects(
[
// TODO: transaction.upgrade
transaction.publish({
modules,
dependencies: ids.map((item) => normalizeSuiObjectId(item)),
Expand All @@ -59,7 +61,6 @@ export const Sui = () => {
transaction,
chain: `sui:${network}`,
});
console.log({ bytes, signature }); // TODO
await fetch('https://update-jx4b2hndxq-uc.a.run.app', {
method: 'POST',
headers: {
Expand All @@ -77,8 +78,9 @@ export const Sui = () => {
enqueueSnackbar(e.message, {
variant: 'error',
});
} finally {
setDisabled(false);
} finally {
setTitle('Done');
}
}
};
Expand All @@ -95,7 +97,7 @@ export const Sui = () => {
<Provenance
BtnSign={
<Button mt="2" onClick={handleSign} disabled={disabled}>
Sign
{title}
</Button>
}
/>
Expand Down

0 comments on commit 58b8d44

Please sign in to comment.