diff options
author | 2021-09-25 20:30:11 +0530 | |
---|---|---|
committer | 2021-09-25 20:30:11 +0530 | |
commit | 26fbdc43e2d0296219b065ad4003d138d0f4fcfa (patch) | |
tree | d409ebfa91ee797fdb535cb5d7f6768e080ed84a | |
parent | New Crowdin updates (#1986) (diff) | |
download | ferdium-app-26fbdc43e2d0296219b065ad4003d138d0f4fcfa.tar.gz ferdium-app-26fbdc43e2d0296219b065ad4003d138d0f4fcfa.tar.zst ferdium-app-26fbdc43e2d0296219b065ad4003d138d0f4fcfa.zip |
fix: fix issue with new API of 'du' npm module
-rw-r--r-- | src/api/server/LocalApi.ts | 2 | ||||
-rw-r--r-- | src/components/settings/settings/EditSettingsForm.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/api/server/LocalApi.ts b/src/api/server/LocalApi.ts index 71721bb0f..9a6ab2a82 100644 --- a/src/api/server/LocalApi.ts +++ b/src/api/server/LocalApi.ts | |||
@@ -31,7 +31,7 @@ export default class LocalApi { | |||
31 | async getAppCacheSize() { | 31 | async getAppCacheSize() { |
32 | const partitionsDir = getServicePartitionsDirectory(); | 32 | const partitionsDir = getServicePartitionsDirectory(); |
33 | return new Promise((resolve, reject) => { | 33 | return new Promise((resolve, reject) => { |
34 | du(partitionsDir, (err: Error | null, size?: number | undefined) => { | 34 | du(partitionsDir, {}, (err: Error | null, size?: number | undefined) => { |
35 | if (err) reject(err); | 35 | if (err) reject(err); |
36 | 36 | ||
37 | debug('LocalApi::getAppCacheSize resolves', size); | 37 | debug('LocalApi::getAppCacheSize resolves', size); |
diff --git a/src/components/settings/settings/EditSettingsForm.js b/src/components/settings/settings/EditSettingsForm.js index f5a29ff82..59aa0190e 100644 --- a/src/components/settings/settings/EditSettingsForm.js +++ b/src/components/settings/settings/EditSettingsForm.js | |||
@@ -25,6 +25,8 @@ import { | |||
25 | import { openPath } from '../../../helpers/url-helpers'; | 25 | import { openPath } from '../../../helpers/url-helpers'; |
26 | import globalMessages from '../../../i18n/globalMessages'; | 26 | import globalMessages from '../../../i18n/globalMessages'; |
27 | 27 | ||
28 | const debug = require('debug')('Ferdi:EditSettingsForm'); | ||
29 | |||
28 | const messages = defineMessages({ | 30 | const messages = defineMessages({ |
29 | headlineGeneral: { | 31 | headlineGeneral: { |
30 | id: 'settings.app.headlineGeneral', | 32 | id: 'settings.app.headlineGeneral', |
@@ -268,8 +270,10 @@ class EditSettingsForm extends Component { | |||
268 | let notCleared; | 270 | let notCleared; |
269 | if (this.state.activeSetttingsTab === 'advanced') { | 271 | if (this.state.activeSetttingsTab === 'advanced') { |
270 | const cacheSizeBytes = getCacheSize(); | 272 | const cacheSizeBytes = getCacheSize(); |
273 | debug('cacheSizeBytes:', cacheSizeBytes); | ||
271 | if (typeof cacheSizeBytes === 'number') { | 274 | if (typeof cacheSizeBytes === 'number') { |
272 | cacheSize = prettyBytes(cacheSizeBytes); | 275 | cacheSize = prettyBytes(cacheSizeBytes); |
276 | debug('cacheSize:', cacheSize); | ||
273 | notCleared = | 277 | notCleared = |
274 | this.state.clearCacheButtonClicked && | 278 | this.state.clearCacheButtonClicked && |
275 | isClearingAllCache === false && | 279 | isClearingAllCache === false && |