From bb4eb33c853d0f0e4298fcb1860a8875775c0844 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Wed, 8 Jul 2026 17:49:43 +0300 Subject: [PATCH] fix chat message sending not working --- src/api/chats.js | 2 +- src/api/helpers.js | 3 ++- src/components/chat/chat.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/api/chats.js b/src/api/chats.js index 51e83c74f..114038e52 100644 --- a/src/api/chats.js +++ b/src/api/chats.js @@ -4,7 +4,7 @@ import { parseChat } from 'src/services/entity_normalizer/entity_normalizer.serv const PLEROMA_CHATS_URL = '/api/v1/pleroma/chats' const PLEROMA_CHAT_URL = (id) => `/api/v1/pleroma/chats/by-account-id/${id}` -const PLEROMA_CHAT_MESSAGES_URL = (id, { maxId, sinceId, limit }) => +const PLEROMA_CHAT_MESSAGES_URL = (id, { maxId, sinceId, limit } = {}) => `/api/v1/pleroma/chats/${id}/messages${paramsString({ maxId, sinceId, limit })}` const PLEROMA_CHAT_READ_URL = (id) => `/api/v1/pleroma/chats/${id}/read` const PLEROMA_DELETE_CHAT_MESSAGE_URL = (chatId, messageId) => diff --git a/src/api/helpers.js b/src/api/helpers.js index f965750c5..ce41eca77 100644 --- a/src/api/helpers.js +++ b/src/api/helpers.js @@ -17,7 +17,6 @@ export const paramsString = (params = {}) => { } })() - if (entries.length === 0) return '' const arrays = [] const nonArrays = [] @@ -48,6 +47,8 @@ export const paramsString = (params = {}) => { }) }) + if (nonArrays.length + arrays.length === 0) return '' + return ( '?' + [ diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js index 273d9d85d..ca7a025ec 100644 --- a/src/components/chat/chat.js +++ b/src/components/chat/chat.js @@ -382,7 +382,7 @@ const Chat = { if (retriesLeft <= 0) return sendChatMessage({ - params, + ...params, credentials: useOAuthStore().token, }) .then(({ data }) => {