MOBILE-2478 desktop: Don't display free space in desktop
parent
6e026bd813
commit
c4f60e902d
|
@ -20,7 +20,7 @@
|
||||||
<p>{{ 'core.settings.total' | translate }}</p>
|
<p>{{ 'core.settings.total' | translate }}</p>
|
||||||
<p item-end>{{ totalUsage | coreBytesToSize }}</p>
|
<p item-end>{{ totalUsage | coreBytesToSize }}</p>
|
||||||
</ion-item-divider>
|
</ion-item-divider>
|
||||||
<ion-item-divider color="light">
|
<ion-item-divider color="light" *ngIf="showFreeSpace">
|
||||||
<p>{{ 'core.settings.estimatedfreespace' | translate }}</p>
|
<p>{{ 'core.settings.estimatedfreespace' | translate }}</p>
|
||||||
<p item-end>{{ freeSpace | coreBytesToSize }}</p>
|
<p item-end>{{ freeSpace | coreBytesToSize }}</p>
|
||||||
</ion-item-divider>
|
</ion-item-divider>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
import { Component, } from '@angular/core';
|
import { Component, } from '@angular/core';
|
||||||
import { IonicPage } from 'ionic-angular';
|
import { IonicPage } from 'ionic-angular';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { CoreAppProvider } from '@providers/app';
|
||||||
import { CoreFileProvider } from '@providers/file';
|
import { CoreFileProvider } from '@providers/file';
|
||||||
import { CoreFilepoolProvider } from '@providers/filepool';
|
import { CoreFilepoolProvider } from '@providers/filepool';
|
||||||
import { CoreSitesProvider } from '@providers/sites';
|
import { CoreSitesProvider } from '@providers/sites';
|
||||||
|
@ -36,11 +37,13 @@ export class CoreSettingsSpaceUsagePage {
|
||||||
currentSiteId = '';
|
currentSiteId = '';
|
||||||
totalUsage = 0;
|
totalUsage = 0;
|
||||||
freeSpace = 0;
|
freeSpace = 0;
|
||||||
|
showFreeSpace = true;
|
||||||
|
|
||||||
constructor(private fileProvider: CoreFileProvider, private filePoolProvider: CoreFilepoolProvider,
|
constructor(private fileProvider: CoreFileProvider, private filePoolProvider: CoreFilepoolProvider,
|
||||||
private sitesProvider: CoreSitesProvider, private textUtils: CoreTextUtilsProvider,
|
private sitesProvider: CoreSitesProvider, private textUtils: CoreTextUtilsProvider,
|
||||||
private translate: TranslateService, private domUtils: CoreDomUtilsProvider) {
|
private translate: TranslateService, private domUtils: CoreDomUtilsProvider, appProvider: CoreAppProvider) {
|
||||||
this.currentSiteId = this.sitesProvider.getCurrentSiteId();
|
this.currentSiteId = this.sitesProvider.getCurrentSiteId();
|
||||||
|
this.showFreeSpace = !appProvider.isDesktop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,10 +115,15 @@ export class CoreSettingsSpaceUsagePage {
|
||||||
* @return {Promise<any>} Resolved when done.
|
* @return {Promise<any>} Resolved when done.
|
||||||
*/
|
*/
|
||||||
protected fetchData(): Promise<any> {
|
protected fetchData(): Promise<any> {
|
||||||
return Promise.all([
|
const promises = [
|
||||||
this.calculateSizeUsage().then(() => this.calculateTotalUsage()),
|
this.calculateSizeUsage().then(() => this.calculateTotalUsage()),
|
||||||
this.calculateFreeSpace(),
|
];
|
||||||
]);
|
|
||||||
|
if (this.showFreeSpace) {
|
||||||
|
promises.push(this.calculateFreeSpace());
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.all(promises);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue