mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
set time for chat token
This commit is contained in:
@@ -342,6 +342,7 @@ export class ChatService {
|
||||
|
||||
setheader() {
|
||||
try {
|
||||
|
||||
if (this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
@@ -352,6 +353,8 @@ export class ChatService {
|
||||
this.options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
|
||||
this.resetTimer()
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -386,4 +389,14 @@ export class ChatService {
|
||||
|
||||
}
|
||||
|
||||
|
||||
functionTimer = null;
|
||||
|
||||
resetTimer() {
|
||||
clearTimeout(this.functionTimer);
|
||||
this.functionTimer = setTimeout(()=>{
|
||||
this.refreshtoken();
|
||||
}, 60000 * 5); // time is in milliseconds
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user