From 5c932e5a27c752b737c7053237c1b164c45bffff Mon Sep 17 00:00:00 2001 From: pk5ls20 Date: Fri, 7 Feb 2025 19:20:35 +0800 Subject: [PATCH] fix: native rkey --- src/core/apis/file.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/apis/file.ts b/src/core/apis/file.ts index c93d0f8e..a6847ac7 100644 --- a/src/core/apis/file.ts +++ b/src/core/apis/file.ts @@ -434,9 +434,9 @@ export class NTQQFileApi { }; try { - if (this.core.apis.PacketApi.available && this.packetRkey?.[0] && this.packetRkey?.[1]) { - const rkey_expired_private = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000; - const rkey_expired_group = !this.packetRkey || this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000; + if (this.core.apis.PacketApi.available) { + const rkey_expired_private = !this.packetRkey || (this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000); + const rkey_expired_group = !this.packetRkey || (this.packetRkey[0] && this.packetRkey[0].time + Number(this.packetRkey[0].ttl) < Date.now() / 1000); if (rkey_expired_private || rkey_expired_group) { this.packetRkey = await this.fetchRkeyWithRetry(); }