mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -55,22 +55,17 @@ export class AuthService {
|
||||
if (SessionStore.exist) {
|
||||
this.ValidatedUser = SessionStore.user
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ){
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
|
||||
this.loginToChatWs()
|
||||
}
|
||||
}
|
||||
|
||||
if (localStorage.getItem("userChat") != null) {
|
||||
if(SessionStore?.user?.ChatData) {
|
||||
this.ValidatedUserChat = SessionStore.user.ChatData
|
||||
console.log('!!!!::!!!!', SessionStore.user)
|
||||
}
|
||||
|
||||
if(!this.ValidatedUserChat.hasOwnProperty('data')) {
|
||||
this.ValidatedUserChat = {
|
||||
data: JSON.parse(localStorage.getItem('userChat'))
|
||||
};
|
||||
} else {
|
||||
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -142,6 +137,8 @@ export class AuthService {
|
||||
|
||||
SessionStore.reset(session)
|
||||
this.ValidatedUser = SessionStore.user;
|
||||
|
||||
console.log('!!!::!!===', this.ValidatedUser)
|
||||
this.storageService.store(AuthConnstants.USER, response);
|
||||
|
||||
return true;
|
||||
@@ -154,9 +151,9 @@ export class AuthService {
|
||||
//user: UserForm
|
||||
async loginChat(responseChat = this.ValidatedUserChat) {
|
||||
|
||||
this.ValidatedUserChat = responseChat;
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
if(SessionStore?.user?.ChatData) {
|
||||
this.ValidatedUserChat = SessionStore.user.ChatData
|
||||
}
|
||||
|
||||
/* const expirationMinutes = 30;
|
||||
let date = new Date().getTime();
|
||||
|
||||
Reference in New Issue
Block a user