Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(desktop): 目录发现的在线手机写入后续词典广播集合

Dashe392acdffb83
diff --git a/apps/desktop/src/main/device-link/index.ts b/apps/desktop/src/main/device-link/index.ts
index 7d9fac5cfe..36d717e63d 100644
--- a/apps/desktop/src/main/device-link/index.ts
+++ b/apps/desktop/src/main/device-link/index.ts
@@ -280,14 +280,19 @@ async function runControllerDisplayNamesFromDirectory(
// 目录补齐展示名的同时,给这些手机补一次只读词典投影。
for (const device of result.devices ?? []) {
const deviceId = typeof device.deviceId === 'string' ? device.deviceId : '';
+ const platform = typeof device.platform === 'string' ? device.platform : '';
if (
!deviceId
|| device.online !== true
- || !isMobilePlatform(typeof device.platform === 'string' ? device.platform : null)
+ || !isMobilePlatform(platform)
|| isDeviceRevoked(deviceId)
) {
continue;
}
+ // 目录发现也要写回后续广播读的那份在线集合,否则只补发一次,
+ // 词典变更 / 开关切换时 listOnlineMobileDevices 仍是空的。
+ presenceOnlineByDevice.set(deviceId, true);
+ setControllerPlatform(deviceId, platform);
handleMobilePeerOnline(deviceId);
}
} catch (err) {