mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
improve
This commit is contained in:
@@ -61,9 +61,15 @@ export class AuthService {
|
||||
}
|
||||
|
||||
if (localStorage.getItem("userChat") != null) {
|
||||
this.ValidatedUserChat = {
|
||||
data: JSON.parse(localStorage.getItem('userChat'))
|
||||
};
|
||||
|
||||
if(!this.ValidatedUserChat.hasOwnProperty('data')) {
|
||||
this.ValidatedUserChat = {
|
||||
data: JSON.parse(localStorage.getItem('userChat'))
|
||||
};
|
||||
} else {
|
||||
this.ValidatedUserChat = JSON.parse(localStorage.getItem('userChat'))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -149,8 +155,8 @@ export class AuthService {
|
||||
async loginChat(responseChat = this.ValidatedUserChat) {
|
||||
|
||||
this.ValidatedUserChat = responseChat;
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||
|
||||
/* const expirationMinutes = 30;
|
||||
let date = new Date().getTime();
|
||||
|
||||
@@ -50,7 +50,7 @@ export class ChatService {
|
||||
|
||||
}
|
||||
|
||||
getDocumentDetails(url:string){
|
||||
getDocumentDetails(url:string) {
|
||||
let headersc = new HttpHeaders();
|
||||
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||
headersc = headersc.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||
@@ -71,19 +71,19 @@ export class ChatService {
|
||||
});
|
||||
}
|
||||
|
||||
getAllChannels(){
|
||||
getAllChannels() {
|
||||
return this.http.get(environment.apiChatUrl+'channels.list', this.options);
|
||||
}
|
||||
|
||||
getAllUserChannels(){
|
||||
getAllUserChannels() {
|
||||
return this.http.get(environment.apiChatUrl+'channels.list.joined', this.options);
|
||||
}
|
||||
|
||||
getAllRooms(){
|
||||
getAllRooms() {
|
||||
return this.http.get(environment.apiChatUrl+'rooms.get', this.options);
|
||||
}
|
||||
|
||||
getRoomInfo(roomId:any){
|
||||
getRoomInfo(roomId:any) {
|
||||
let params = new HttpParams();
|
||||
params = params.set("roomId", roomId);
|
||||
let opts = {
|
||||
|
||||
Reference in New Issue
Block a user