update token

This commit is contained in:
Peter Maquiran
2022-09-30 15:50:18 +01:00
parent baff5d96ff
commit 598a145ad4
+18 -1
View File
@@ -401,6 +401,24 @@ export class ChatService {
}
lastUpdateIs10sAgo() {
const currentTime: any = new Date();
const diffTime = Math.abs(currentTime - this.timerEventTriggerDateLastUpdate);
if(this.timerEventTriggerDateLastUpdate == null) {
return true
}
if(diffTime >= 5000) {
return true
}
return false
}
functionTimer = null;
timerEventTriggerDate = null
timerEventTriggerDateLastUpdate = null
@@ -410,7 +428,6 @@ export class ChatService {
this.timerEventTriggerDate = new Date(+new Date() + 60000*15);
this.functionTimer = setTimeout(() => {
this.timerEventTriggerDateLastUpdate = new Date();
this.refreshtoken();
}, 60000 * 5); // time is in milliseconds
}