mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-05 22:42:25 +08:00
6a454ec624
Removed unused ContactUserStore.exportingCsv and ContactUserStore.exportingVcf
24 lines
470 B
JavaScript
24 lines
470 B
JavaScript
import ko from 'ko';
|
|
|
|
export const QuotaUserStore = new class {
|
|
constructor() {
|
|
this.quota = ko.observable(0);
|
|
this.usage = ko.observable(0);
|
|
|
|
this.percentage = ko.computed(() => {
|
|
const quota = this.quota(),
|
|
usage = this.usage();
|
|
|
|
return 0 < quota ? Math.ceil((usage / quota) * 100) : 0;
|
|
});
|
|
}
|
|
|
|
/**
|
|
* @param {number} quota
|
|
* @param {number} usage
|
|
*/
|
|
populateData(quota, usage) {
|
|
this.quota(quota * 1024);
|
|
this.usage(usage * 1024);
|
|
}
|
|
};
|