feat(Client): make use of with_expiration in #fetchInvite (#5764)

This commit is contained in:
Souji
2021-06-07 10:58:26 +02:00
committed by GitHub
parent 4567cd4ca2
commit bf191df9c0
2 changed files with 7 additions and 2 deletions

View File

@@ -109,6 +109,8 @@ class Invite extends Base {
* @type {?number}
*/
this.createdTimestamp = 'created_at' in data ? new Date(data.created_at).getTime() : null;
this._expiresTimestamp = 'expires_at' in data ? new Date(data.expires_at).getTime() : null;
}
/**
@@ -141,7 +143,10 @@ class Invite extends Base {
* @readonly
*/
get expiresTimestamp() {
return this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null;
return (
this._expiresTimestamp ??
(this.createdTimestamp && this.maxAge ? this.createdTimestamp + this.maxAge * 1000 : null)
);
}
/**