diff --git a/src/App.tsx b/src/App.tsx index 3ab4e40..7bce629 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -796,14 +796,18 @@ function App() { balanceSetIntervalRef.current = setInterval(async () => { if (isCalling) return; isCalling = true; - chrome?.runtime?.sendMessage({ action: "balance" }, (response) => { + window + .sendMessage("balance") + .then((response) => { if (!response?.error && !isNaN(+response)) { setBalance(response); } - - isCalling = false + isCalling = false; + }) + .catch((error) => { + console.error("Failed to get balance:", error); + isCalling = false; }); - }, 40000); } catch (error) { console.error(error) @@ -819,12 +823,13 @@ function App() { setBalance(response); } setQortBalanceLoading(false); - balanceSetInterval() + }) .catch((error) => { console.error("Failed to get balance:", error); setQortBalanceLoading(false); }); + balanceSetInterval() }; const getLtcBalanceFunc = () => { setLtcBalanceLoading(true); diff --git a/src/components/BuyQortInformation.tsx b/src/components/BuyQortInformation.tsx index b6aed75..eace455 100644 --- a/src/components/BuyQortInformation.tsx +++ b/src/components/BuyQortInformation.tsx @@ -64,8 +64,7 @@ export const BuyQortInformation = ({balance}) => { - + )} + - - - )} )} diff --git a/src/components/Group/ThingsToDoInitial.tsx b/src/components/Group/ThingsToDoInitial.tsx index c810ebc..d69c34f 100644 --- a/src/components/Group/ThingsToDoInitial.tsx +++ b/src/components/Group/ThingsToDoInitial.tsx @@ -12,6 +12,7 @@ import { Box, Typography } from "@mui/material"; import { Spacer } from "../../common/Spacer"; import { isMobile } from "../../App"; import { QMailMessages } from "./QMailMessages"; +import { executeEvent } from "../../utils/events"; export const ThingsToDoInitial = ({ myAddress, name, hasGroups, balance , userInfo}) => { const [checked1, setChecked1] = React.useState(false); @@ -94,7 +95,6 @@ return null { + executeEvent("openBuyQortInfo", {}) + }} > - { + executeEvent('openRegisterName', {}) + }} sx={{ padding: "0px", }} disableRipple role={undefined} dense> @@ -207,16 +212,7 @@ return null - - // - // - // } + {/* - + */} diff --git a/src/components/RegisterName.tsx b/src/components/RegisterName.tsx index 35af458..d68e075 100644 --- a/src/components/RegisterName.tsx +++ b/src/components/RegisterName.tsx @@ -178,6 +178,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL open={isOpen} aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description" + fullWidth > {"Register name"} @@ -185,8 +186,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL setRegisterNameValue(e.target.value)} @@ -299,7 +300,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL Close