mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Switch from ko.computed to ko.pureComputed
This should provide performance and memory benefits over regular computed observables
This commit is contained in:
parent
ac2238a23f
commit
954de06f86
18 changed files with 55 additions and 37 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import ko from 'ko';
|
||||
import { koComputable } from 'External/ko';
|
||||
|
||||
import { FolderType, FolderSortMode } from 'Common/EnumsUser';
|
||||
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
|
||||
|
|
@ -100,7 +101,7 @@ export const FolderUserStore = new class {
|
|||
archiveFolder: fSetSystemFolderType(FolderType.Archive)
|
||||
});
|
||||
|
||||
self.quotaPercentage = ko.computed(() => {
|
||||
self.quotaPercentage = koComputable(() => {
|
||||
const quota = self.quotaLimit(), usage = self.quotaUsage();
|
||||
return 0 < quota ? Math.ceil((usage / quota) * 100) : 0;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue