adapted the counter to status parsing

This commit is contained in:
Nicolas Constant 2019-03-08 23:53:04 -05:00
parent 7977867dbc
commit 18aca897be
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
1 changed files with 10 additions and 5 deletions

View File

@ -95,11 +95,16 @@ export class CreateStatusComponent implements OnInit, OnDestroy {
}
private countStatusChar(status: string){
// const maxLength = 500;
const statusLength = status.length;
const mod = statusLength % this.maxCharLength;
this.charCountLeft = this.maxCharLength - mod;
this.postCounts = Math.trunc(statusLength/this.maxCharLength) + 1;
const parseStatus = this.parseStatus(status);
const currentStatus = parseStatus[parseStatus.length - 1];
const statusLength = currentStatus.length;
this.charCountLeft = this.maxCharLength - statusLength;
this.postCounts = parseStatus.length;
// const mod = statusLength % this.maxCharLength;
// this.charCountLeft = this.maxCharLength - mod;
// this.postCounts = Math.trunc(statusLength/this.maxCharLength) + 1;
}
private getMentions(status: Status, providerInfo: AccountInfo): string[] {