aboutsummaryrefslogtreecommitdiffstats
path: root/src/stores/AppStore.js
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2021-05-13 11:58:35 +0200
committerLibravatar GitHub <noreply@github.com>2021-05-13 11:58:35 +0200
commit5db9f585e8cec20abdadf431d667422af66cf692 (patch)
treec1d7d57c5d9370385249acba1bedcfb931d42158 /src/stores/AppStore.js
parentNew Crowdin updates for Japanese (#1406) (diff)
downloadferdium-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/AppStore.js')
-rw-r--r--src/stores/AppStore.js3
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';
5import moment from 'moment'; 5import moment from 'moment';
6import AutoLaunch from 'auto-launch'; 6import AutoLaunch from 'auto-launch';
7import prettyBytes from 'pretty-bytes';
8import ms from 'ms'; 7import ms from 'ms';
9import { URL } from 'url'; 8import { URL } from 'url';
10import os from 'os'; 9import 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() {