feat: update openclaw and polish desktop flows
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user