-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto Update feature added to start.js and EntrySection.js and update.…
…js made for dialog modal on start checking the availablity of update files
- Loading branch information
Showing
9 changed files
with
136 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,9 +44,6 @@ function App() { | |
<EntrySection /> | ||
</Box> | ||
|
||
|
||
|
||
|
||
</Box> | ||
|
||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { Box, Button, CircularProgress, Dialog, DialogActions, DialogContent, DialogTitle, LinearProgress, Stack, Typography } from "@mui/material"; | ||
import { useState } from "react"; | ||
const { ipcRenderer } = window.require('electron'); | ||
|
||
|
||
const UpdateModal = ({open, setOpen}) => { | ||
const [text, setText] = useState(''); | ||
const [progress, setProgress] = useState(0); | ||
const [total, setTotal] = useState(0); | ||
const [speed, setSpeed] = useState(0); | ||
|
||
ipcRenderer.on('updateMsg', (event, message) => { | ||
if (message.type === 'availaible'){ | ||
setText('ورژن شما به روز نیست. کمی صبر کنید تا بروزرسانی انجام شود') | ||
} | ||
}); | ||
|
||
ipcRenderer.on('updateMsg', (event, message) => { | ||
if (message.type === 'notAvailable'){ | ||
setText('ورژن شما به روز است و احتیاجی به بروزرسانی نیست') | ||
setTimeout(() => { | ||
setOpen(false) | ||
}, 1500); | ||
} | ||
}); | ||
|
||
ipcRenderer.on('updateMsg', (event, message) => { | ||
if (message.type === 'error'){ | ||
setText('مشکلی در بروزرسانی پیش اومده') | ||
} | ||
}); | ||
|
||
ipcRenderer.on('updateMsg', (event, message) => { | ||
if (message.type === 'progress'){ | ||
setTotal(message.progressObj.total) | ||
setProgress(message.progressObj.percent) | ||
setSpeed(message.progressObj.bytesPerSecond) | ||
} | ||
}); | ||
|
||
|
||
|
||
return ( | ||
<Box> | ||
<Dialog sx={{ backgroundColor: 'rgba(252, 243, 224, 0.6)', backdropFilter: 'blur(12px) saturate(180%)' }} open={open} keepMounted onClose={() => setOpen(false)}> | ||
<DialogTitle sx={{display:'flex', justifyContent:"center", alignItems:'center'}}> | ||
<Typography> | ||
بروز رسانی نرم افزار | ||
</Typography> | ||
</DialogTitle> | ||
<DialogContent sx={{width:400, height:150}} dividers> | ||
<Stack spacing={5}> | ||
<Box sx={{mt:2, mb:4, display:'flex', justifyContent:"center", alignItems:'center' }}> | ||
<Typography variant="subtitle2">{text}</Typography> | ||
</Box> | ||
|
||
<Box sx={{display:'flex', justifyContent:"center", alignItems:'center'}}> | ||
<CircularProgress color="info"/> | ||
</Box> | ||
</Stack> | ||
|
||
</DialogContent> | ||
</Dialog> | ||
</Box> | ||
); | ||
} | ||
|
||
export default UpdateModal; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters