set time for chat token

This commit is contained in:
Peter Maquiran
2022-09-30 14:09:50 +01:00
parent 6df9e1f30a
commit 47dee7180a
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -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
}
}