diff options
author | 2022-01-05 19:29:02 +0100 | |
---|---|---|
committer | 2022-01-05 19:29:02 +0100 | |
commit | a96fa55be7f6a957fe5d153b9a2e1ff640c6b25b (patch) | |
tree | 3e4e5eea3346d1ae1bda794fafba29b773a11e44 /src/components | |
parent | #512 Restrict in-app update to Mac, Windows and AppImage (diff) | |
download | ferdium-app-a96fa55be7f6a957fe5d153b9a2e1ff640c6b25b.tar.gz ferdium-app-a96fa55be7f6a957fe5d153b9a2e1ff640c6b25b.tar.zst ferdium-app-a96fa55be7f6a957fe5d153b9a2e1ff640c6b25b.zip |
Make dismissable services update infobar cta available in updates tab
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 24ba644f4..bdb8484d4 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -5,7 +5,8 @@ import { observer } from 'mobx-react'; | |||
5 | import prettyBytes from 'pretty-bytes'; | 5 | import prettyBytes from 'pretty-bytes'; |
6 | import { defineMessages, injectIntl } from 'react-intl'; | 6 | import { defineMessages, injectIntl } from 'react-intl'; |
7 | 7 | ||
8 | import { mdiGithub, mdiOpenInNew } from '@mdi/js'; | 8 | import { mdiGithub, mdiOpenInNew, mdiPowerPlug } from '@mdi/js'; |
9 | |||
9 | import Form from '../../../lib/Form'; | 10 | import Form from '../../../lib/Form'; |
10 | import Button from '../../ui/Button'; | 11 | import Button from '../../ui/Button'; |
11 | import Toggle from '../../ui/Toggle'; | 12 | import Toggle from '../../ui/Toggle'; |
@@ -175,6 +176,14 @@ const messages = defineMessages({ | |||
175 | id: 'settings.app.restartRequired', | 176 | id: 'settings.app.restartRequired', |
176 | defaultMessage: 'Changes require restart', | 177 | defaultMessage: 'Changes require restart', |
177 | }, | 178 | }, |
179 | servicesUpdated: { | ||
180 | id: 'infobar.servicesUpdated', | ||
181 | defaultMessage: 'Your services have been updated.', | ||
182 | }, | ||
183 | buttonReloadServices: { | ||
184 | id: 'infobar.buttonReloadServices', | ||
185 | defaultMessage: 'Reload services', | ||
186 | }, | ||
178 | numberOfColumns: { | 187 | numberOfColumns: { |
179 | id: 'settings.app.form.splitColumns', | 188 | id: 'settings.app.form.splitColumns', |
180 | defaultMessage: 'Number of columns', | 189 | defaultMessage: 'Number of columns', |
@@ -768,9 +777,9 @@ class EditSettingsForm extends Component { | |||
768 | {this.state.activeSetttingsTab === 'updates' && ( | 777 | {this.state.activeSetttingsTab === 'updates' && ( |
769 | <div> | 778 | <div> |
770 | <Toggle field={form.$('automaticUpdates')} /> | 779 | <Toggle field={form.$('automaticUpdates')} /> |
771 | {(isMac || isWindows || process.env.APPIMAGE) && ( | 780 | {automaticUpdates && ( |
772 | <> | 781 | <> |
773 | {automaticUpdates && ( | 782 | {(isMac || isWindows || process.env.APPIMAGE) && ( |
774 | <> | 783 | <> |
775 | <div> | 784 | <div> |
776 | <Toggle field={form.$('beta')} /> | 785 | <Toggle field={form.$('beta')} /> |
@@ -810,6 +819,23 @@ class EditSettingsForm extends Component { | |||
810 | )} | 819 | )} |
811 | </> | 820 | </> |
812 | )} | 821 | )} |
822 | {showServicesUpdatedInfoBar ? ( | ||
823 | <> | ||
824 | <p> | ||
825 | <Icon icon={mdiPowerPlug} /> | ||
826 | {intl.formatMessage(messages.servicesUpdated)} | ||
827 | </p> | ||
828 | <Button | ||
829 | label={intl.formatMessage(messages.buttonReloadServices)} | ||
830 | onClick={() => window.location.reload()} | ||
831 | /> | ||
832 | </> | ||
833 | ) : ( | ||
834 | <p> | ||
835 | <Icon icon={mdiPowerPlug} /> | ||
836 | Your services are up-to-date. | ||
837 | </p> | ||
838 | )} | ||
813 | </> | 839 | </> |
814 | )} | 840 | )} |
815 | <p className="settings__message"> | 841 | <p className="settings__message"> |