fix logout

This commit is contained in:
Peter Maquiran
2022-07-21 18:05:29 +01:00
parent 48eb19b1a1
commit 5533116e9d
10 changed files with 49 additions and 31 deletions
@@ -14,7 +14,6 @@ import { SortService } from '../functions/sort.service';
import { chatUser } from 'src/app/models/chatMethod';
import { NfService } from 'src/app/services/chat/nf.service'
import { ChangeProfileService } from '../change-profile.service';
import { AuthService } from '../auth.service';
import { ChatStorageService } from './chat-storage.service';
import { ChatMethodsService } from './chat-methods.service';
import { AESEncrypt } from '../aesencrypt.service'
@@ -41,7 +40,7 @@ export class WsChatMethodsService {
users: chatUser[] = []
sessionStore = SessionStore
loggedUser: any;
delete = []
@@ -56,7 +55,6 @@ export class WsChatMethodsService {
private NfService: NfService,
private changeProfileService: ChangeProfileService,
private chatService: ChatService,
private authService: AuthService,
private ChatStorageService: ChatStorageService,
private ChatMethodsService:ChatMethodsService,
private AESEncrypt: AESEncrypt,
@@ -64,7 +62,7 @@ export class WsChatMethodsService {
private NetworkServiceService: NetworkServiceService,
) {
this.loggedUser = authService.ValidatedUserChat['data'];
this.loadChat()
@@ -93,13 +91,6 @@ export class WsChatMethodsService {
})
// on change profile remove a rooms
this.changeProfileService.registerCallback(() => {
this.clearChat()
this.ReLoadChat()
this.storage.remove('Rooms');
})
}
private loadChat() {
@@ -173,8 +164,10 @@ export class WsChatMethodsService {
async getAllRooms () {
this.loadingWholeList = true
const rooms = await this.WsChatService.getRooms();
try {
await this.storage.remove('Rooms');
} catch(e) {}
await this.storage.remove('Rooms');
await rooms.result.update.forEach( async (roomData: room, index) => {
const roomId = this.getRoomId(roomData);