diff options
author | 2020-04-22 14:28:08 +0000 | |
---|---|---|
committer | 2020-04-22 14:28:08 +0000 | |
commit | aeb80edd47b5ac55111d9cf83942485a7ea38cd5 (patch) | |
tree | 8d3d49d52ad91898aca141e541b672d964435200 | |
parent | New Crowdin translations (#615) (diff) | |
download | ferdium-app-aeb80edd47b5ac55111d9cf83942485a7ea38cd5.tar.gz ferdium-app-aeb80edd47b5ac55111d9cf83942485a7ea38cd5.tar.zst ferdium-app-aeb80edd47b5ac55111d9cf83942485a7ea38cd5.zip |
Improve cache clearing UI feedback (#620)
* Warning about using Nodejs versions > 10
I removed the warning about using nodejs versions above 10 because they function well in the dev environement.
* clear all cache issue
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 24 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 3 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index 5cd8bdb36..6d86c09ec 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -99,6 +99,10 @@ const messages = defineMessages({ | |||
99 | id: 'settings.app.cacheInfo', | 99 | id: 'settings.app.cacheInfo', |
100 | defaultMessage: '!!!Ferdi cache is currently using {size} of disk space.', | 100 | defaultMessage: '!!!Ferdi cache is currently using {size} of disk space.', |
101 | }, | 101 | }, |
102 | cacheNotCleared: { | ||
103 | id: 'settings.app.cacheNotCleared', | ||
104 | defaultMessage: 'Couldn\'t clear all cache', | ||
105 | }, | ||
102 | buttonClearAllCache: { | 106 | buttonClearAllCache: { |
103 | id: 'settings.app.buttonClearAllCache', | 107 | id: 'settings.app.buttonClearAllCache', |
104 | defaultMessage: '!!!Clear cache', | 108 | defaultMessage: '!!!Clear cache', |
@@ -169,6 +173,14 @@ export default @observer class EditSettingsForm extends Component { | |||
169 | intl: intlShape, | 173 | intl: intlShape, |
170 | }; | 174 | }; |
171 | 175 | ||
176 | state={ | ||
177 | clearCacheButtonClicked: false, | ||
178 | } | ||
179 | |||
180 | onClearCacheClicked=() => { | ||
181 | this.setState({ clearCacheButtonClicked: true }); | ||
182 | } | ||
183 | |||
172 | submit(e) { | 184 | submit(e) { |
173 | e.preventDefault(); | 185 | e.preventDefault(); |
174 | this.props.form.submit({ | 186 | this.props.form.submit({ |
@@ -217,7 +229,7 @@ export default @observer class EditSettingsForm extends Component { | |||
217 | lockingFeatureEnabled, | 229 | lockingFeatureEnabled, |
218 | scheduledDNDEnabled, | 230 | scheduledDNDEnabled, |
219 | } = window.ferdi.stores.settings.all.app; | 231 | } = window.ferdi.stores.settings.all.app; |
220 | 232 | const notCleared = this.state.clearCacheButtonClicked && isClearingAllCache === false && cacheSize !== 0; | |
221 | return ( | 233 | return ( |
222 | <div className="settings__main"> | 234 | <div className="settings__main"> |
223 | <div className="settings__header"> | 235 | <div className="settings__header"> |
@@ -483,11 +495,17 @@ export default @observer class EditSettingsForm extends Component { | |||
483 | size: cacheSize, | 495 | size: cacheSize, |
484 | })} | 496 | })} |
485 | </p> | 497 | </p> |
498 | {notCleared && ( | ||
499 | <p> | ||
500 | {intl.formatMessage(messages.cacheNotCleared) | ||
501 | } | ||
502 | </p> | ||
503 | )} | ||
486 | <p> | 504 | <p> |
487 | <Button | 505 | <Button |
488 | buttonType="secondary" | 506 | buttonType="secondary" |
489 | label={intl.formatMessage(messages.buttonClearAllCache)} | 507 | label={intl.formatMessage(messages.buttonClearAllCache)} |
490 | onClick={onClearAllCache} | 508 | onClick={() => { onClearAllCache(); this.onClearCacheClicked(); }} |
491 | disabled={isClearingAllCache} | 509 | disabled={isClearingAllCache} |
492 | loaded={!isClearingAllCache} | 510 | loaded={!isClearingAllCache} |
493 | /> | 511 | /> |
@@ -542,10 +560,12 @@ export default @observer class EditSettingsForm extends Component { | |||
542 | <span className="mdi mdi-github-face" /> | 560 | <span className="mdi mdi-github-face" /> |
543 | <span> | 561 | <span> |
544 | 562 | ||
563 | |||
545 | Ferdi is based on | 564 | Ferdi is based on |
546 | {' '} | 565 | {' '} |
547 | <a href="https://github.com/meetfranz/franz" target="_blank">Franz</a> | 566 | <a href="https://github.com/meetfranz/franz" target="_blank">Franz</a> |
548 | 567 | ||
568 | |||
549 | , a project published | 569 | , a project published |
550 | under the | 570 | under the |
551 | {' '} | 571 | {' '} |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index fd92569b9..1800626cf 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -276,6 +276,7 @@ | |||
276 | "settings.app.buttonInstallUpdate": "Restart & install update", | 276 | "settings.app.buttonInstallUpdate": "Restart & install update", |
277 | "settings.app.buttonSearchForUpdate": "Check for updates", | 277 | "settings.app.buttonSearchForUpdate": "Check for updates", |
278 | "settings.app.cacheInfo": "Ferdi cache is currently using {size} of disk space.", | 278 | "settings.app.cacheInfo": "Ferdi cache is currently using {size} of disk space.", |
279 | "settings.app.cacheNotCleared": "Couldn't clear all cache", | ||
279 | "settings.app.currentVersion": "Current version:", | 280 | "settings.app.currentVersion": "Current version:", |
280 | "settings.app.form.accentColor": "Accent color", | 281 | "settings.app.form.accentColor": "Accent color", |
281 | "settings.app.form.adaptableDarkMode": "Synchronize dark mode with my OS's dark mode setting", | 282 | "settings.app.form.adaptableDarkMode": "Synchronize dark mode with my OS's dark mode setting", |
@@ -524,4 +525,4 @@ | |||
524 | "workspaceDrawer.workspaceFeatureInfo": "<p>Ferdi Workspaces let you focus on what’s important right now. Set up different sets of services and easily switch between them at any time.</p><p>You decide which services you need when and where, so we can help you stay on top of your game - or easily switch off from work whenever you want.</p>", | 525 | "workspaceDrawer.workspaceFeatureInfo": "<p>Ferdi Workspaces let you focus on what’s important right now. Set up different sets of services and easily switch between them at any time.</p><p>You decide which services you need when and where, so we can help you stay on top of your game - or easily switch off from work whenever you want.</p>", |
525 | "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", | 526 | "workspaceDrawer.workspacesSettingsTooltip": "Edit workspaces settings", |
526 | "workspaces.switchingIndicator.switchingTo": "Switching to" | 527 | "workspaces.switchingIndicator.switchingTo": "Switching to" |
527 | } | 528 | } \ No newline at end of file |