Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
happylolonly committed May 30, 2024
1 parent 3715306 commit 7265b8e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
32 changes: 16 additions & 16 deletions front/src/components/main/TonWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ const TonWallet = ({ nickname, message, type }) => {
}

const handleSwitchWalletFunction = () => {
if (connected) {
console.log(">>> Send message to bacend");
} else {
tonConnectUI.disconnect();

const d = toBase64(toAscii(data));

tonConnectUI.setConnectRequestParameters({
state: "ready",
value: {
tonProof: d,
},
});

tonConnectUI.connectWallet();
}
// if (connected) {
// console.log(">>> Send message to bacend");
// } else {
tonConnectUI.disconnect();

const d = toBase64(toAscii(data));

tonConnectUI.setConnectRequestParameters({
state: "ready",
value: {
tonProof: d,
},
});

tonConnectUI.connectWallet();
// }
};

return (
Expand Down
9 changes: 9 additions & 0 deletions front/src/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const Main = () => {

const [passportProof, setPassportProof] = useState();
const [textProof, setTextProof] = useState();
const [apiLoading, setApiLoading] = useState(false);

const [step, setStep] = useState(Steps.INITIAL);

Expand All @@ -57,6 +58,7 @@ const Main = () => {

async function sendProofCall() {
try {
setApiLoading(true);
const { address, publicKey } = wallet.account || {};

const d = {
Expand All @@ -79,6 +81,7 @@ const Main = () => {
} catch (error) {
console.error(error);
}
setApiLoading(false);
}

// @ts-ignore
Expand Down Expand Up @@ -208,6 +211,12 @@ const Main = () => {
<Button onClick={() => setTxHash(null)}>Close</Button>
</>
);
} else if (apiLoading) {
actionBarContent = (
<>
<Button disabled>pending...</Button>
</>
);
} else {
actionBarContent = (
<>
Expand Down

0 comments on commit 7265b8e

Please sign in to comment.