feat: update openclaw and polish desktop flows

This commit is contained in:
inman
2026-05-13 21:52:17 +08:00
parent 7c8781a6e3
commit 86795078f7
22 changed files with 1145 additions and 186 deletions

View File

@@ -273,7 +273,10 @@ export function ChannelConfigModal({
const err = typeof args[0] === 'string'
? args[0]
: String((args[0] as { message?: string } | undefined)?.message || args[0]);
toast.error(translateRef.current('toast.qrFailed', { name: CHANNEL_NAMES[channelType], error: err }));
const errorText = channelType === 'whatsapp' && /websocket|network|proxy/i.test(err)
? translateRef.current('toast.whatsappNetworkHint', { error: err })
: translateRef.current('toast.qrFailed', { name: CHANNEL_NAMES[channelType], error: err });
toast.error(errorText);
setQrCode(null);
setConnecting(false);
};
@@ -370,10 +373,13 @@ export function ChannelConfigModal({
}
if (meta.connectionType === 'qr') {
await hostApiFetch(`/api/channels/${encodeURIComponent(selectedType)}/start`, {
const startResult = await hostApiFetch<{ success?: boolean; error?: string }>(`/api/channels/${encodeURIComponent(selectedType)}/start`, {
method: 'POST',
body: JSON.stringify(resolvedAccountId ? { accountId: resolvedAccountId } : {}),
});
if (!startResult?.success) {
throw new Error(startResult?.error || 'Failed to start QR login');
}
return;
}