From 3540a029bddf3222860e912e5cae43796293d8f8 Mon Sep 17 00:00:00 2001 From: binarybaron <86064887+binarybaron@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:02:10 +0100 Subject: [PATCH] feat(gui): Refer to external Github release page when download is ready (#169) --- .../modal/updater/UpdaterDialog.tsx | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/src-gui/src/renderer/components/modal/updater/UpdaterDialog.tsx b/src-gui/src/renderer/components/modal/updater/UpdaterDialog.tsx index 58c5628d..69a0bc8f 100644 --- a/src-gui/src/renderer/components/modal/updater/UpdaterDialog.tsx +++ b/src-gui/src/renderer/components/modal/updater/UpdaterDialog.tsx @@ -11,12 +11,16 @@ import { makeStyles, LinearProgressProps, Box, + Link, } from '@material-ui/core'; import SystemUpdateIcon from '@material-ui/icons/SystemUpdate'; import { check, Update, DownloadEvent } from '@tauri-apps/plugin-updater'; import { useSnackbar } from 'notistack'; import { relaunch } from '@tauri-apps/plugin-process'; +const GITHUB_RELEASES_URL = "https://github.com/UnstoppableSwap/core/releases"; +const HOMEPAGE_URL = "https://unstoppableswap.net/"; + const useStyles = makeStyles((theme) => ({ progress: { marginTop: theme.spacing(2) @@ -54,16 +58,16 @@ export default function UpdaterDialog() { const classes = useStyles(); const [availableUpdate, setAvailableUpdate] = useState(null); const [downloadProgress, setDownloadProgress] = useState(null); - const {enqueueSnackbar} = useSnackbar(); + const { enqueueSnackbar } = useSnackbar(); useEffect(() => { // Check for updates when component mounts check().then((updateResponse) => { - setAvailableUpdate(updateResponse); + setAvailableUpdate(updateResponse); }).catch((err) => { - enqueueSnackbar(`Failed to check for updates: ${err}`, { - variant: 'error', - }); + enqueueSnackbar(`Failed to check for updates: ${err}`, { + variant: 'error', + }); }); }, []); @@ -93,9 +97,9 @@ export default function UpdaterDialog() { // Once the promise resolves, relaunch the application for the new version to be used relaunch(); } catch (err) { - enqueueSnackbar(`Failed to install update: ${err}`, { - variant: "error" - }); + enqueueSnackbar(`Failed to install update: ${err}`, { + variant: "error" + }); } }; @@ -116,7 +120,8 @@ export default function UpdaterDialog() { A new version (v{availableUpdate.version}) is available. Your current version is {availableUpdate.currentVersion}. - The update will be verified using PGP signature verification to ensure authenticity. + The update will be verified using PGP signature verification to ensure authenticity. Alternatively, you can download the + update from GitHub or visit the download page. {availableUpdate.body && ( <> @@ -128,16 +133,15 @@ export default function UpdaterDialog() { )} - + {isDownloading && ( - )}