mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
last sentry changed
This commit is contained in:
@@ -50,10 +50,13 @@ export class AuthService {
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
if (SessionStore.exist) {
|
||||
|
||||
SessionStore.setInativity(true)
|
||||
|
||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ) {
|
||||
this.loginToChatWs()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -392,9 +392,13 @@ export class ChatService {
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
} else if (!this.headers) {
|
||||
this.setheader()
|
||||
await this.refreshtoken();
|
||||
this.refreshtoken()
|
||||
} else {
|
||||
setTimeout(async ()=>{
|
||||
await this.refreshtoken();
|
||||
}, 4000)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -136,9 +136,14 @@ export class MessageService {
|
||||
|
||||
private usernameToDisplayName(username) {
|
||||
|
||||
const firstName = capitalizeTxt(username.split('.')[0])
|
||||
const lastName = capitalizeTxt(username.split('.')[1])
|
||||
return firstName + ' ' + lastName
|
||||
try {
|
||||
const firstName = capitalizeTxt(username.split('.')[0])
|
||||
const lastName = capitalizeTxt(username.split('.')[1])
|
||||
return firstName + ' ' + lastName
|
||||
} catch (error) {
|
||||
return username
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async send(): Promise<any> {
|
||||
|
||||
@@ -992,9 +992,14 @@ export class RoomService {
|
||||
|
||||
usernameToDisplayName(username) {
|
||||
|
||||
const firstName = capitalizeTxt(username.split('.')[0])
|
||||
const lastName = capitalizeTxt(username.split('.')[1])
|
||||
return firstName + ' ' + lastName
|
||||
try {
|
||||
const firstName = capitalizeTxt(username.split('.')[0])
|
||||
const lastName = capitalizeTxt(username.split('.')[1])
|
||||
return firstName + ' ' + lastName
|
||||
} catch(error) {
|
||||
return username
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sendReadMessage() {
|
||||
|
||||
@@ -17,7 +17,7 @@ export class TimeService {
|
||||
end = new Date();
|
||||
start = new Date(start);
|
||||
|
||||
const totalSeconds = Math.floor((end - (start))/1000);;
|
||||
const totalSeconds = Math.floor((end - (start))/1000);
|
||||
const totalMinutes = Math.floor(totalSeconds/60);
|
||||
const totalHours = Math.floor(totalMinutes/60);
|
||||
const totalDays = Math.floor(totalHours/24);
|
||||
@@ -75,37 +75,37 @@ export class TimeService {
|
||||
}
|
||||
|
||||
countDownDateTimer(date:any, roomId:string){
|
||||
let timer = setInterval(() =>{
|
||||
let difference = new Date(date).getTime() - new Date().getTime();
|
||||
let c_day = Math.floor(difference/(1000*60*60*24));
|
||||
let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
|
||||
let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||
let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||
// let timer = setInterval(() =>{
|
||||
// let difference = new Date(date).getTime() - new Date().getTime();
|
||||
// let c_day = Math.floor(difference/(1000*60*60*24));
|
||||
// let c_hours = Math.floor((difference % (1000*60*60*24)) / (1000*60*60));
|
||||
// let c_minutes = Math.floor((difference % (1000*60*60)) / (1000*60));
|
||||
// let c_seconds = Math.floor((difference % (1000*60)) / 1000);
|
||||
|
||||
this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||
// this.countDownTime = this.addZero(c_day) + " : " + this.addZero(c_hours) + " : " + this.addZero(c_minutes) + " : " + this.addZero(c_seconds) ;
|
||||
|
||||
if(difference < 0) {
|
||||
clearInterval(timer);
|
||||
this.countDownTime = "Expired";
|
||||
let body = { "roomId":roomId, }
|
||||
this.chatService.getRoomInfo(roomId).subscribe(room=>{
|
||||
this.room = room['room'];
|
||||
// if(difference < 0) {
|
||||
// clearInterval(timer);
|
||||
// this.countDownTime = "Expired";
|
||||
// let body = { "roomId":roomId, }
|
||||
// this.chatService.getRoomInfo(roomId).subscribe(room=>{
|
||||
// this.room = room['room'];
|
||||
|
||||
if(this.room.t === 'p'){
|
||||
this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
else{
|
||||
// if(this.room.t === 'p'){
|
||||
// this.chatService.deleteGroup(body).subscribe(res=>{
|
||||
// this.ChatSystemService.deleteRoom(roomId)
|
||||
// });
|
||||
// }
|
||||
// else{
|
||||
|
||||
this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
this.ChatSystemService.deleteRoom(roomId)
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
return this.countDownTime;
|
||||
// this.chatService.deleteChannel(body).subscribe(res=>{
|
||||
// this.ChatSystemService.deleteRoom(roomId)
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
// return this.countDownTime;
|
||||
}
|
||||
|
||||
addZero(i) {
|
||||
|
||||
@@ -118,9 +118,9 @@ export class NotificationsService {
|
||||
};
|
||||
|
||||
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
|
||||
console.log(data)
|
||||
//console.log(data)
|
||||
}, (error) => {
|
||||
console.log(error)
|
||||
//console.log(error)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user