fix: message sending fallback + iOS zoom on input + openOrCreatePrivate

- MessageInput: HTTP fallback when WebSocket not OPEN (prevents silent failures)
- WsClient: add trySend() returning bool to detect WS availability
- Backend: POST /api/messages/chat/:chatId endpoint for HTTP message send
- openOrCreatePrivate: use openChat() for consistency after refreshing chat list
- iOS fix: inputs get font-size:16px on mobile to prevent Safari auto-zoom

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ai
2026-05-22 12:44:42 +03:00
parent 2a4b7d5abc
commit 87c6d7f82f
5 changed files with 99 additions and 23 deletions

View File

@@ -59,6 +59,14 @@ class WsClient {
}
}
trySend(type: string, payload: any): boolean {
if (this.ws?.readyState === WebSocket.OPEN) {
this.ws.send(JSON.stringify({ type, payload }));
return true;
}
return false;
}
disconnect() {
this.token = null;
if (this.reconnectTimer) clearTimeout(this.reconnectTimer);