Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { Login } from './components/Login';
import { Dashboard } from './components/Dashboard';

// Create socket with autoConnect disabled so we can add listeners before connecting
const API_URL = process.env.REACT_APP_API_URL || 'http://localhost:3001';
// Derive backend URL from the page's host so Docker/remote deploys work without rebuild.
// Override with REACT_APP_API_URL (build-time) or REACT_APP_SOCKET_URL (runtime).
const API_URL = process.env.REACT_APP_API_URL
|| process.env.REACT_APP_SOCKET_URL
|| `${window.location.protocol}//${window.location.hostname}:3001`;
export const socket: Socket = io(API_URL, { autoConnect: false });

export type Platform = 'whatsapp' | 'signal';
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/ContactCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function ContactCard({
<XAxis dataKey="timestamp" hide />
<YAxis domain={['auto', 'auto']} />
<Tooltip
labelFormatter={(t: number) => new Date(t).toLocaleTimeString()}
labelFormatter={(t) => new Date(Number(t)).toLocaleTimeString()}
contentStyle={{ borderRadius: '8px', border: 'none', boxShadow: '0 4px 6px -1px rgb(0 0 0 / 0.1)' }}
/>
<Line type="monotone" dataKey="avg" stroke="#3b82f6" strokeWidth={2} dot={false} name="Avg RTT" isAnimationActive={false} />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"scripts": {
"build": "tsc",
"start": "npx tsx src/index.ts",
"start:server": "npm run start:signal-api && npx tsx src/server.ts",
"start:server": "npm run start:signal-api || true && npx tsx src/server.ts",
"start:signal-api": "npx tsx src/scripts/init-signal.ts",
"start:client": "cd client && npm start",
"dev": "npm run start:server",
Expand Down
1 change: 1 addition & 0 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ async function connectToWhatsApp() {
const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys');

sock = makeWASocket({
version: [2, 3000, 1034074495],
auth: state,
logger: pino({ level: 'debug' }),
markOnlineOnConnect: true,
Expand Down