Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #230 from CTemplar/bugfix/feedback-2018092701
Browse files Browse the repository at this point in the history
Bugfix/feedback 2018092701
  • Loading branch information
atifsaddique211f authored Sep 27, 2018
2 parents c2ca3e8 + ec3586d commit d65a569
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
11 changes: 10 additions & 1 deletion src/app/mail/mail-detail/mail-detail.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,17 @@ <h5 class="ui-header-subtitle text-dark mb-0">
<app-progress-bar [active]="!decryptedContents[mail.id]"></app-progress-bar>

<div class="ui-body" *ngIf="decryptedContents[mail.id]">
<div class="msg-reply-content text-dark" id="{{mail.id}}-mail-content"
<div [ngClass]="{'show_gmail_extra': mailOptions[mail.id]?.showGmailExtraContent}">
<div class="msg-reply-content text-dark" id="{{mail.id}}-mail-content"
[innerHTML]="decryptedContents[mail.id] | safe: 'html'"></div>
<a href="javascript:void(0)" (click)="toggleGmailExtra(mail)"
*ngIf="decryptedContents[mail.id]?.indexOf('gmail_extra') > -1 || decryptedContents[mail.id]?.indexOf('gmail_quote') > -1" >
<div class="ellipsis-wrapper" placement="top"
[ngbTooltip]="mailOptions[mail.id]?.showGmailExtraContent ? 'Hide extra content' : 'Show trimmed content'">
<div class="gmail-ellipsis"></div>
</div>
</a>
</div>
</div>

<ul class="list-style-none mt-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<div class="col-sm-4 mailbox-actionbar-col hidden-xs-down" *ngIf="mails?.length>0">
<div class="mail-controls d-flex align-items-center justify-content-end">
<div class="mail-result-text text-muted">
<small>{{ OFFSET * LIMIT }}-{{ ( OFFSET * LIMIT ) + (LIMIT > MAX_EMAIL_PAGE_LIMIT? MAX_EMAIL_PAGE_LIMIT :LIMIT) }} of {{ MAX_EMAIL_PAGE_LIMIT }}</small>
<small>{{ OFFSET }} - {{(LIMIT > MAX_EMAIL_PAGE_LIMIT - OFFSET) ? MAX_EMAIL_PAGE_LIMIT : LIMIT }} of {{ MAX_EMAIL_PAGE_LIMIT }}</small>
</div>
<div class="mail-nav-control">
<button role="button" class="mail-nav-control-prev" (click)="prevPage()">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class GenericFolderComponent implements OnInit, OnDestroy, OnChanges {
MAX_EMAIL_PAGE_LIMIT: number = 1;
LIMIT: number;
OFFSET: number = 0;
PAGE: number = 0;

constructor(public store: Store<AppState>,
private router: Router,
Expand Down Expand Up @@ -105,7 +106,7 @@ export class GenericFolderComponent implements OnInit, OnDestroy, OnChanges {

refresh(forceReload: boolean = false) {
if (!forceReload && this.mailFolder === MailFolderType.INBOX) {
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder, read: false, seconds: 30 }));
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: 0, folder: this.mailFolder, read: false, seconds: 30 }));
} else {
this.store.dispatch(new GetMails({ forceReload, limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder }));
}
Expand Down Expand Up @@ -258,16 +259,18 @@ export class GenericFolderComponent implements OnInit, OnDestroy, OnChanges {
}

prevPage() {
if (this.OFFSET > 0) {
this.OFFSET--;
this.refresh();
if (this.PAGE > 0) {
this.PAGE--;
this.OFFSET = this.PAGE * this.LIMIT;
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder }));
}
}

nextPage() {
if (this.OFFSET < (this.MAX_EMAIL_PAGE_LIMIT - 1)) {
this.OFFSET++;
this.refresh();
if (((this.PAGE + 1) * this.LIMIT) < this.MAX_EMAIL_PAGE_LIMIT) {
this.OFFSET = (this.PAGE + 1) * this.LIMIT;
this.PAGE++;
this.store.dispatch(new GetMails({ limit: this.LIMIT, offset: this.OFFSET, folder: this.mailFolder }));
}
}

Expand Down

0 comments on commit d65a569

Please sign in to comment.