Remind about server update later on dialog close
Stop opening server update info dialog for one hour after the dialog was closed
This commit is contained in:
@@ -43,7 +43,7 @@ export const ServerUpdateChecker = () => {
|
|||||||
setOpen(false);
|
setOpen(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
useUpdateChecker('server', checkForUpdate);
|
const updateChecker = useUpdateChecker('server', checkForUpdate, selectedServerChannelInfo?.tag);
|
||||||
|
|
||||||
if (isCheckingForServerUpdate) {
|
if (isCheckingForServerUpdate) {
|
||||||
return null;
|
return null;
|
||||||
@@ -62,13 +62,12 @@ export const ServerUpdateChecker = () => {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!updateChecker.handleUpdate) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog open={open} aria-labelledby="alert-dialog-title" aria-describedby="alert-dialog-description">
|
||||||
open={open}
|
|
||||||
onClose={handleClose}
|
|
||||||
aria-labelledby="alert-dialog-title"
|
|
||||||
aria-describedby="alert-dialog-description"
|
|
||||||
>
|
|
||||||
<DialogTitle id="alert-dialog-title">{t('global.update.label.available')}</DialogTitle>
|
<DialogTitle id="alert-dialog-title">{t('global.update.label.available')}</DialogTitle>
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<DialogContentText id="alert-dialog-description">
|
<DialogContentText id="alert-dialog-description">
|
||||||
@@ -80,6 +79,14 @@ export const ServerUpdateChecker = () => {
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button onClick={handleClose}>{t('global.label.close')}</Button>
|
<Button onClick={handleClose}>{t('global.label.close')}</Button>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
updateChecker.remindLater();
|
||||||
|
handleClose();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t('global.button.remind_later')}
|
||||||
|
</Button>
|
||||||
<Button onClick={handleClose} variant="contained" href={selectedServerChannelInfo.url} target="_blank">
|
<Button onClick={handleClose} variant="contained" href={selectedServerChannelInfo.url} target="_blank">
|
||||||
{t('chapter.action.download.add.label.action')}
|
{t('chapter.action.download.add.label.action')}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user