Bug session expired resolved

This commit is contained in:
Eudes Inácio
2022-06-08 11:56:56 +01:00
parent f1e8cedc35
commit 73d0696ea6
15 changed files with 121 additions and 9 deletions
@@ -5,6 +5,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { ThemeService } from 'src/app/services/theme.service'
import { SetRoomOwnerPage } from 'src/app/modals/set-room-owner/set-room-owner.page';
import { WsChatMethodsService } from 'src/app/services/chat/ws-chat-methods.service';
import { HttpErrorResponse } from '@angular/common/http';
@Component({
@@ -168,6 +169,12 @@ export class ChatPopoverPage implements OnInit {
});
}
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.deleteGroup();
}
});
this.popoverController.dismiss('delete');
this.modalController.dismiss('delete');
@@ -1,3 +1,4 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { ModalController, NavParams, PopoverController } from '@ionic/angular';
import { ChatService } from 'src/app/services/chat.service';
@@ -41,6 +42,12 @@ export class MessagesOptionsPage implements OnInit {
let body = { "roomId": this.roomId }
this.chatService.removeChatRoom(body).subscribe(res=>{
},(error: HttpErrorResponse) => {
if(error.status === 401){
this.chatService.refreshtoken()
this.closeChatRoom();
}
});
this.close();
}