Improve loader

This commit is contained in:
Peter Maquiran
2021-07-12 11:13:29 +01:00
parent c526426aec
commit 507ebd691a
34 changed files with 400 additions and 32 deletions
+10 -2
View File
@@ -4,6 +4,7 @@ import { Status } from 'src/app/models/chat/status.model';
import { AlertService } from 'src/app/services/alert.service';
import { AuthService } from 'src/app/services/auth.service';
import { ChatService } from 'src/app/services/chat.service';
import { ToastService } from 'src/app/services/toast.service';
import { ChatOptionsPopoverPage } from 'src/app/shared/popover/chat-options-popover/chat-options-popover.page';
import { MessagesOptionsPage } from 'src/app/shared/popover/messages-options/messages-options.page';
import { ProfileComponent } from '../../headers/header-no-search/profile/profile.page';
@@ -37,6 +38,7 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
private authService: AuthService,
private animationController: AnimationController,
private alertService: AlertService,
private toastService: ToastService,
) {
/* this.dm = this.navParams.get('dm'); */
}
@@ -84,9 +86,15 @@ export class MessagesPage implements OnInit, AfterViewChecked, OnChanges {
console.log(this.roomId);
}
scrollToBottom(): void {
const loader = this.toastService.loading()
try {
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
this.myScrollContainer.nativeElement.scrollTop = this.myScrollContainer.nativeElement.scrollHeight;
} catch(err) { }
finally {
loader.remove()
}
}
loadMoreMessages(ev:any){