diff --git a/frontend/src/components/TradeBox/EncryptedChat/EncryptedSocketChat/index.tsx b/frontend/src/components/TradeBox/EncryptedChat/EncryptedSocketChat/index.tsx index f7d3787b..29c15683 100644 --- a/frontend/src/components/TradeBox/EncryptedChat/EncryptedSocketChat/index.tsx +++ b/frontend/src/components/TradeBox/EncryptedChat/EncryptedSocketChat/index.tsx @@ -114,10 +114,11 @@ const EncryptedSocketChat: React.FC = ({ if (!slot?.token) return; const url = federation.getCoordinator(order.shortAlias).url; + const protocol = url.includes('https') ? 'wss://' : 'ws://'; websocketClient .open( - `${url.replace(/^https?:\/\//, 'ws://')}/ws/chat/${ + `${url.replace(/^https?:\/\//, protocol)}/ws/chat/${ order.id }/?token_sha256_hex=${sha256(slot?.token)}`, ) diff --git a/frontend/src/components/TradeBox/Prompts/Successful.tsx b/frontend/src/components/TradeBox/Prompts/Successful.tsx index e64ecbb4..800a69c7 100644 --- a/frontend/src/components/TradeBox/Prompts/Successful.tsx +++ b/frontend/src/components/TradeBox/Prompts/Successful.tsx @@ -59,12 +59,13 @@ export const SuccessfulPrompt = ({ const coordinatorPubKey = federation.getCoordinator(order.shortAlias)?.nostrHexPubkey; if (!coordinatorToken) { + console.error('Missing coordinator token'); setTokenError(true); return; } if (!slot?.nostrPubKey || !slot.nostrSecKey || !coordinatorPubKey || !order.id) { - setHostRating(0); + console.error('Rating not valid'); return; } diff --git a/frontend/src/services/RoboPool/index.ts b/frontend/src/services/RoboPool/index.ts index bc3d1f0a..7e4dbb05 100644 --- a/frontend/src/services/RoboPool/index.ts +++ b/frontend/src/services/RoboPool/index.ts @@ -137,7 +137,7 @@ class RoboPool { const requestRatings = [ 'REQ', - `subscribeRatings${id}`, + `subscribeRatings${id ?? ''}`, { kinds: [31986], '#p': pubkeys ?? defaultPubkeys, since: 1746316800 }, ];