chore: remove debug

This commit is contained in:
手瓜一十雪 2024-07-23 10:12:20 +08:00
parent efb2be2f94
commit 8bf1a545d9

View File

@ -37,7 +37,7 @@ setTimeout(() => {
// const sendMessagePool: Record<string, ((sendSuccessMsg: RawMessage) => void | Promise<void>) | null> = {};// peerUid: callbackFunc // const sendMessagePool: Record<string, ((sendSuccessMsg: RawMessage) => void | Promise<void>) | null> = {};// peerUid: callbackFunc
const sendSuccessCBMap: Record<string, ((sendSuccessMsg: RawMessage) => boolean | Promise<boolean>) | null> = {};// uuid: callbackFunc // const sendSuccessCBMap: Record<string, ((sendSuccessMsg: RawMessage) => boolean | Promise<boolean>) | null> = {};// uuid: callbackFunc
const GroupFileInfoUpdateTasks: Map<string, ((groupFileListResult: onGroupFileInfoUpdateParamType) => void)> = new Map(); const GroupFileInfoUpdateTasks: Map<string, ((groupFileListResult: onGroupFileInfoUpdateParamType) => void)> = new Map();
@ -66,26 +66,26 @@ msgListener.onGroupFileInfoUpdate = (groupFileListResult: onGroupFileInfoUpdateP
// } // }
// }; // };
msgListener.onMsgInfoListUpdate = (msgInfoList: RawMessage[]) => { // msgListener.onMsgInfoListUpdate = (msgInfoList: RawMessage[]) => {
msgInfoList.forEach(msg => { // msgInfoList.forEach(msg => {
new Promise((resolve, reject) => { // new Promise((resolve, reject) => {
for (const cbId in sendSuccessCBMap) { // for (const cbId in sendSuccessCBMap) {
const cb = sendSuccessCBMap[cbId]!; // const cb = sendSuccessCBMap[cbId]!;
const cbResult = cb(msg); // const cbResult = cb(msg);
const checkResult = (result: boolean) => { // const checkResult = (result: boolean) => {
if (result) { // if (result) {
delete sendSuccessCBMap[cbId]; // delete sendSuccessCBMap[cbId];
} // }
}; // };
if (cbResult instanceof Promise) { // if (cbResult instanceof Promise) {
cbResult.then(checkResult); // cbResult.then(checkResult);
} else { // } else {
checkResult(cbResult); // checkResult(cbResult);
} // }
} // }
}).then().catch(log); // }).then().catch(log);
}); // });
}; // };