Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
feat: List files compatible with current system on UpdaterDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
binarybaron committed Jun 19, 2024
1 parent 2668da2 commit 29cb052
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/renderer/components/modal/updater/UpdaterDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import {
DialogContentText,
DialogActions,
Button,
Typography,
} from '@material-ui/core';
import { UpdateInfo } from 'electron-updater';
import { UpdateFileInfo, UpdateInfo } from 'electron-updater';
import { useAppDispatch, useAppSelector } from 'store/hooks';
import { updateShownToUser } from 'store/features/updateSlice';

Expand All @@ -23,18 +24,19 @@ export default function UpdaterDialog() {
dispatch(updateShownToUser());
}

const releasePageUrl = `https://github.com/UnstoppableSwap/unstoppableswap-gui/releases/tag/v${
updateNotification!.version
}/`;

function openDownloadUrl() {
const downloadUrl = `https://github.com/UnstoppableSwap/unstoppableswap-gui/releases/tag/v${
updateNotification!.version
}`;
window.open(downloadUrl, '_blank');
window.open(releasePageUrl, '_blank');
hideNotification();
}

return (
<Dialog
fullWidth
maxWidth="xs"
maxWidth="sm"
open={Boolean(updateNotification)}
onClose={() => hideNotification()}
>
Expand All @@ -44,9 +46,17 @@ export default function UpdaterDialog() {
A new version (v{updateNotification.version}) of the software was
released on{' '}
{new Date(updateNotification.releaseDate).toLocaleDateString()}.
Please download and install the update manually to benefit from new
features and enhancements. Staying updated ensures you have the latest
improvements and security fixes.
<br />
Updating ensures you have the latest improvements and security fixes. Please visit the release page, download one of the files listed below, and install it manually.
<Typography variant="caption">
<ul style={{ padding: '0', paddingLeft: '1rem' }}>
{updateNotification.files.map((file) => (
<li key={file.url}>
{file.url}
</li>
))}
</ul>
</Typography>
</DialogContentText>
</DialogContent>
<DialogActions>
Expand All @@ -63,7 +73,7 @@ export default function UpdaterDialog() {
onClick={openDownloadUrl}
color="primary"
>
Download
OPEN DOWNLOAD PAGE
</Button>
</DialogActions>
</Dialog>
Expand Down

0 comments on commit 29cb052

Please sign in to comment.