i18n: Upgrade translations from crowdin (61e08dd5). (pass-desktop)
[ProtonMail-WebClient.git] / packages / docs-core / lib / Controller / Document / SizeTracker.ts
blob5f33a55f728abbd2b50535012bfe6daa2fa8899a
1 import { MAX_DOC_SIZE, MAX_UPDATE_SIZE } from '../../Models/Constants'
3 export class DocSizeTracker {
4   private currentSize = 0
6   incrementSize(size: number) {
7     this.currentSize += size
8   }
10   canPostUpdateOfSize(size: number) {
11     return this.currentSize + size <= MAX_DOC_SIZE && size <= MAX_UPDATE_SIZE
12   }
14   resetWithSize(size: number) {
15     this.currentSize = size
16   }