fix(service-party-app): 补全 getSessionStatus 返回的 threshold 和 participants

问题:
- Session.tsx 期望 session 对象有 threshold 和 participants 字段
- 但 grpc:getSessionStatus 只返回了基础字段
- 导致前端显示 参与方 (0 / 0)

修复:
- 从 activeKeygenSession 获取 threshold 信息
- 从 API 返回的 participants 构建完整的参与者列表
- 添加 walletName, currentRound, totalRounds 字段

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-29 11:54:14 -08:00
parent c94f3e4d83
commit 422d7007b1
1 changed files with 15 additions and 0 deletions

View File

@ -859,15 +859,30 @@ function setupIpcHandlers() {
ipcMain.handle('grpc:getSessionStatus', async (_event, { sessionId }) => {
try {
const result = await accountClient?.getSessionStatus(sessionId);
// 从 activeKeygenSession 获取更完整的信息
const threshold = activeKeygenSession?.threshold || { t: 0, n: result?.total_parties || 0 };
const participants = result?.participants?.map((p, idx) => ({
partyId: p.party_id,
partyIndex: p.party_index,
name: activeKeygenSession?.participants?.find(ap => ap.partyId === p.party_id)?.name || `参与方 ${idx + 1}`,
status: p.status,
joinedAt: new Date().toISOString(),
})) || [];
return {
success: true,
session: {
sessionId: result?.session_id,
walletName: activeKeygenSession?.walletName || '',
status: result?.status,
completedParties: result?.completed_parties,
totalParties: result?.total_parties,
sessionType: result?.session_type,
publicKey: result?.public_key,
threshold: threshold,
participants: participants,
currentRound: 0,
totalRounds: 4,
},
};
} catch (error) {