feat: backport (#7778)

This commit is contained in:
Jiralite
2022-04-14 11:45:35 +01:00
committed by GitHub
parent ae7f991e8d
commit ff49b82db7
2 changed files with 6 additions and 3 deletions

View File

@@ -197,8 +197,11 @@ class Invite extends Base {
this.createdTimestamp ??= null;
}
if ('expires_at' in data) this._expiresTimestamp = new Date(data.expires_at).getTime();
else this._expiresTimestamp ??= null;
if ('expires_at' in data) {
this._expiresTimestamp = data.expires_at && Date.parse(data.expires_at);
} else {
this._expiresTimestamp ??= null;
}
if ('stage_instance' in data) {
/**

View File

@@ -118,7 +118,7 @@ class VoiceState extends Base {
* The time at which the member requested to speak. This property is specific to stage channels only.
* @type {?number}
*/
this.requestToSpeakTimestamp = new Date(data.request_to_speak_timestamp).getTime();
this.requestToSpeakTimestamp = data.request_to_speak_timestamp && Date.parse(data.request_to_speak_timestamp);
} else {
this.requestToSpeakTimestamp ??= null;
}