diff options
author | Kristóf Marussy <kristof@marussy.com> | 2021-05-13 11:58:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-13 11:58:35 +0200 |
commit | 5db9f585e8cec20abdadf431d667422af66cf692 (patch) | |
tree | c1d7d57c5d9370385249acba1bedcfb931d42158 /src/stores | |
parent | New Crowdin updates for Japanese (#1406) (diff) | |
download | ferdium-app-5db9f585e8cec20abdadf431d667422af66cf692.tar.gz ferdium-app-5db9f585e8cec20abdadf431d667422af66cf692.tar.zst ferdium-app-5db9f585e8cec20abdadf431d667422af66cf692.zip |
Lazily compute cache size (#1404)
Computing the cache size can take a long time if the cache is large.
Previously, cache size computation was triggered by opening the Settings
pane, which slowed down changing settings even if the user wasn't
interested in the cache size.
This patch defers cache size computation until the Advanced tab is open
in the Setting page.
Additionally, cache size rendering (in MB / GB) is moved from the
AppStore into the EditSettingsForm to fix the notCleared functionality.
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/AppStore.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index 529201df5..c409b6ac7 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js | |||
@@ -4,7 +4,6 @@ import { | |||
4 | } from 'mobx'; | 4 | } from 'mobx'; |
5 | import moment from 'moment'; | 5 | import moment from 'moment'; |
6 | import AutoLaunch from 'auto-launch'; | 6 | import AutoLaunch from 'auto-launch'; |
7 | import prettyBytes from 'pretty-bytes'; | ||
8 | import ms from 'ms'; | 7 | import ms from 'ms'; |
9 | import { URL } from 'url'; | 8 | import { URL } from 'url'; |
10 | import os from 'os'; | 9 | import os from 'os'; |
@@ -257,7 +256,7 @@ export default class AppStore extends Store { | |||
257 | } | 256 | } |
258 | 257 | ||
259 | @computed get cacheSize() { | 258 | @computed get cacheSize() { |
260 | return prettyBytes(this.getAppCacheSizeRequest.execute().result || 0); | 259 | return this.getAppCacheSizeRequest.execute().result; |
261 | } | 260 | } |
262 | 261 | ||
263 | @computed get debugInfo() { | 262 | @computed get debugInfo() { |