This commit is contained in:
PhilReact 2025-03-05 00:08:26 +02:00
parent 74cdd3e34d
commit 1b94584375
6 changed files with 30 additions and 28 deletions

View File

@ -796,14 +796,18 @@ function App() {
balanceSetIntervalRef.current = setInterval(async () => { balanceSetIntervalRef.current = setInterval(async () => {
if (isCalling) return; if (isCalling) return;
isCalling = true; isCalling = true;
chrome?.runtime?.sendMessage({ action: "balance" }, (response) => { window
.sendMessage("balance")
.then((response) => {
if (!response?.error && !isNaN(+response)) { if (!response?.error && !isNaN(+response)) {
setBalance(response); setBalance(response);
} }
isCalling = false;
isCalling = false })
.catch((error) => {
console.error("Failed to get balance:", error);
isCalling = false;
}); });
}, 40000); }, 40000);
} catch (error) { } catch (error) {
console.error(error) console.error(error)
@ -819,12 +823,13 @@ function App() {
setBalance(response); setBalance(response);
} }
setQortBalanceLoading(false); setQortBalanceLoading(false);
balanceSetInterval()
}) })
.catch((error) => { .catch((error) => {
console.error("Failed to get balance:", error); console.error("Failed to get balance:", error);
setQortBalanceLoading(false); setQortBalanceLoading(false);
}); });
balanceSetInterval()
}; };
const getLtcBalanceFunc = () => { const getLtcBalanceFunc = () => {
setLtcBalanceLoading(true); setLtcBalanceLoading(true);

View File

@ -64,8 +64,7 @@ export const BuyQortInformation = ({balance}) => {
<DialogContent> <DialogContent>
<Box <Box
sx={{ sx={{
width: "400px", width: "100%",
maxWidth: '90vw',
height: "400px", height: "400px",
maxHeight: '90vh', maxHeight: '90vh',
display: "flex", display: "flex",

View File

@ -169,6 +169,10 @@ export const Home = ({
<ListOfGroupPromotions /> <ListOfGroupPromotions />
</>
)}
<Divider <Divider
color="secondary" color="secondary"
sx={{ sx={{
@ -197,9 +201,6 @@ export const Home = ({
</Box> </Box>
</Divider> </Divider>
<Explore setMobileViewMode={setMobileViewMode} /> <Explore setMobileViewMode={setMobileViewMode} />
</>
)}
</Box> </Box>
)} )}

View File

@ -12,6 +12,7 @@ import { Box, Typography } from "@mui/material";
import { Spacer } from "../../common/Spacer"; import { Spacer } from "../../common/Spacer";
import { isMobile } from "../../App"; import { isMobile } from "../../App";
import { QMailMessages } from "./QMailMessages"; import { QMailMessages } from "./QMailMessages";
import { executeEvent } from "../../utils/events";
export const ThingsToDoInitial = ({ myAddress, name, hasGroups, balance , userInfo}) => { export const ThingsToDoInitial = ({ myAddress, name, hasGroups, balance , userInfo}) => {
const [checked1, setChecked1] = React.useState(false); const [checked1, setChecked1] = React.useState(false);
@ -94,7 +95,6 @@ return null
<Box <Box
sx={{ sx={{
width: "322px", width: "322px",
minHeight: isMobile ? "165px" : "250px",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
bgcolor: "background.paper", bgcolor: "background.paper",
@ -125,6 +125,9 @@ return null
disableRipple disableRipple
role={undefined} role={undefined}
dense dense
onClick={()=> {
executeEvent("openBuyQortInfo", {})
}}
> >
<ListItemText <ListItemText
sx={{ sx={{
@ -182,7 +185,9 @@ return null
// } // }
disablePadding disablePadding
> >
<ListItemButton sx={{ <ListItemButton onClick={() => {
executeEvent('openRegisterName', {})
}} sx={{
padding: "0px", padding: "0px",
}} disableRipple role={undefined} dense> }} disableRipple role={undefined} dense>
@ -207,16 +212,7 @@ return null
</ListItemIcon> </ListItemIcon>
</ListItemButton> </ListItemButton>
</ListItem> </ListItem>
<ListItem {/* <ListItem
// secondaryAction={
// <IconButton edge="end" aria-label="comments">
// <InfoIcon
// sx={{
// color: "white",
// }}
// />
// </IconButton>
// }
disablePadding disablePadding
> >
<ListItemButton sx={{ <ListItemButton sx={{
@ -243,7 +239,7 @@ return null
/> />
</ListItemIcon> </ListItemIcon>
</ListItemButton> </ListItemButton>
</ListItem> </ListItem> */}
</List> </List>
</Box> </Box>
</Box> </Box>

View File

@ -178,6 +178,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL
open={isOpen} open={isOpen}
aria-labelledby="alert-dialog-title" aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description" aria-describedby="alert-dialog-description"
fullWidth
> >
<DialogTitle id="alert-dialog-title"> <DialogTitle id="alert-dialog-title">
{"Register name"} {"Register name"}
@ -185,8 +186,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL
<DialogContent> <DialogContent>
<Box <Box
sx={{ sx={{
width: "400px", width: "100%",
maxWidth: '90vw',
height: "500px", height: "500px",
maxHeight: '90vh', maxHeight: '90vh',
display: "flex", display: "flex",
@ -198,6 +198,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL
> >
<Label>Choose a name</Label> <Label>Choose a name</Label>
<TextField <TextField
size="small"
autoComplete='off' autoComplete='off'
autoFocus autoFocus
onChange={(e) => setRegisterNameValue(e.target.value)} onChange={(e) => setRegisterNameValue(e.target.value)}
@ -299,7 +300,7 @@ export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxL
Close Close
</Button> </Button>
<Button <Button
disabled={!registerNameValue.trim() ||isLoadingRegisterName || isNameAvailable !== Availability.AVAILABLE || !balance || ((balance && nameFee) && +balance < +nameFee)} // disabled={!registerNameValue.trim() ||isLoadingRegisterName || isNameAvailable !== Availability.AVAILABLE || !balance || ((balance && nameFee) && +balance < +nameFee)}
variant="contained" variant="contained"
onClick={registerName} onClick={registerName}
autoFocus autoFocus

View File

@ -23,7 +23,7 @@ export const CustomizedSnackbars = ({open, setOpen, info, setInfo, duration}) =
return ( return (
<div> <div>
<Snackbar sx={{ <Snackbar sx={{
zIndex: 15 zIndex: 10015
}} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} open={open} autoHideDuration={info?.duration === null ? null : (duration || 6000)} onClose={handleClose}> }} anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }} open={open} autoHideDuration={info?.duration === null ? null : (duration || 6000)} onClose={handleClose}>
<Alert <Alert