Skip to content

Commit

Permalink
refine update flow. add feedback link again
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-stebbings committed Aug 11, 2024
1 parent 6eef161 commit 5897f5a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
12 changes: 10 additions & 2 deletions ui/src/components/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PlusCircleOutlined } from '@ant-design/icons';
import { Button } from 'flowbite-react';
import { HelperText } from 'habit-fract-design-system';
import React from 'react';
Expand Down Expand Up @@ -49,7 +48,7 @@ const Settings: React.FC<SettingsProps> = ({ spheres, setIsModalOpen }) => {
<div className="p-4 settings flex flex-col h-full justify-between">
<section>
<div className="check-updates">
<HelperText>Updates</HelperText>
<HelperText withInfo={false}>Updates</HelperText>
<Button onClick={() => {
checkForAppUpdates(true)
}} className="btn btn-primary w-64 h-12 my-2" size="sm">
Expand All @@ -68,6 +67,15 @@ const Settings: React.FC<SettingsProps> = ({ spheres, setIsModalOpen }) => {
<span>Clear</span>
</Button>
</div>
<div className="feedback-link">
<HelperText withInfo={true} onClickInfo={() => ({
title: "Open Feedback Form",
body: "Click this link to open a window to a feedback form (requires an internet connection) so that you can report comments, feedback or bug reports. If you are reporting a bug, please let me know which operating system you are using and any other relevant information. You will need to right click and press back (or restart) to come back to the app. Thanks!",
})}><span>Bugs/Feedback</span></HelperText>
<Button className="btn btn-secondary w-48 h-12 my-2" size="sm" onClick={(e) => {e.currentTarget.querySelector('a')?.click()}}>
<a href="https://habitfract.net/feedback/" className='text-white'>Link</a>
</Button>
</div>
</section>
<section className="danger-zone">
<HelperText withInfo={true} onClickInfo={() => ({
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ ul.ant-menu-inline .ant-menu-submenu-title[role="menuitem"] {
width: initial;
}

.danger-zone, .cache-settings, .check-updates {
.danger-zone, .feedback-link, .cache-settings, .check-updates {
@apply flex gap-8 mb-4 justify-between items-center pr-2 pb-2 pl-4 border-2;
border-radius: 1.5rem;
}
Expand Down
9 changes: 8 additions & 1 deletion ui/src/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ export async function checkForAppUpdates(onUserClick: false) {
cancelLabel: 'Cancel'
});
if (yes) {
message('Update will download in the background... as you were!')
await update.downloadAndInstall();
await relaunch();
const restart = await ask(`Note: AppImage users will need to re-set the .AppImage as executable after this, and then re-run the file manually. MacOS users may need to move the program into the Applications folder if this update doesn't work, then re-run the update. Debian users may need to set write-access to successfully update.`, {
title: 'Update complete! Restart now?',
kind: 'info',
okLabel: 'Restart',
cancelLabel: 'Cancel'
});
restart && await relaunch();
}
}
}

0 comments on commit 5897f5a

Please # to comment.