fix: arrow function
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2023-06-27 16:09:07 +02:00
parent 6b61d4cca1
commit a9885268c2
1 changed files with 6 additions and 7 deletions

View File

@ -39,7 +39,7 @@ export class Layout extends Component {
this.renewInterval = firtsResult.renewInterval;
const intervalMilliseconds = firtsResult.renewInterval * 1000;
this.inservalId = setInterval(this.checkTokenValidity.bind(this), intervalMilliseconds);
this.inservalId = setInterval(() => this.checkTokenValidity(), intervalMilliseconds);
});
}
@ -52,11 +52,6 @@ export class Layout extends Component {
const nuevaFechaEnMilisegundos = fechaEnMilisegundos + duracionEnMilisegundos; // Sumar los milisegundos
const nuevaFecha = new Date(nuevaFechaEnMilisegundos); // Crear una nueva fecha a partir de los milisegundos
// const created = new Date(this.vnToken.created);
// const createdInSeconds = Math.floor(created.getTime() / 1000);
// const maxSeconds = createdInSeconds + this.vnToken.ttl;
// const maxDate = new Date(maxSeconds);
const now = new Date();
console.log(now > nuevaFecha, now, nuevaFecha);
if (now > nuevaFecha) {
@ -66,8 +61,12 @@ export class Layout extends Component {
let remember = true;
if (window.sessionStorage.vnToken) remember = false;
this.vnToken.set(json.data.token, new Date(), json.data.renewPeriod, remember);
this.vnToken.set(json.data.token, now, json.data.renewPeriod, remember);
}
})
.catch(res => {
if (res.status !== 405)
throw res;
});
}
}