refactor: add available accessor property in PacketClient
This commit is contained in:
1 parent
ef39e7ab01
commit
ba9afcaa06
8 files changed
+13
-9
No files matched your search
@@ -377,7 +377,7 @@ export class NTQQFileApi {
|
||||
online_rkey: false
|
||||
};
|
||||
try {
|
||||
if (this.core.apis.PacketApi.packetClient?.isConnected) {
|
||||
if (this.core.apis.PacketApi.packetClient?.available) {
|
||||
if ((!this.packetRkey || this.packetRkey[0].time > Date.now() / 1000)) {
|
||||
this.packetRkey = await this.core.apis.PacketApi.sendRkeyPacket();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export class NTQQPacketApi {
|
||||
// wtfk tx
|
||||
// 校验失败和异常 可能返回undefined
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!this.isInit || !this.packetClient?.isConnected) {
|
||||
if (!this.isInit || !this.packetClient?.available) {
|
||||
this.core.context.logger.logError('packetClient is not init');
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user