Skip to content

Commit 4c3cfd1

Browse files
authored
Fixed slash commands entered in threads displayed in main chat (#1042)
* Fixed slash commands entered in threads displayed in main chat * Fixing lint issues
1 parent b5f374c commit 4c3cfd1

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

packages/api/src/EmbeddedChatApi.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,15 @@ export default class EmbeddedChatApi {
11911191
return data;
11921192
}
11931193

1194-
async execCommand({ command, params }: { command: string; params: string }) {
1194+
async execCommand({
1195+
command,
1196+
params,
1197+
tmid,
1198+
}: {
1199+
command: string;
1200+
params: string;
1201+
tmid?: string;
1202+
}) {
11951203
const { userId, authToken } = (await this.auth.getCurrentUser()) || {};
11961204
const response = await fetch(`${this.host}/api/v1/commands.run`, {
11971205
headers: {
@@ -1203,6 +1211,7 @@ export default class EmbeddedChatApi {
12031211
body: JSON.stringify({
12041212
command,
12051213
params,
1214+
tmid,
12061215
roomId: this.rid,
12071216
triggerId: Math.random().toString(32).slice(2, 20),
12081217
}),

packages/react/src/views/ChatInput/ChatInput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ const ChatInput = ({ scrollToBottom, clearUnreadDividerRef }) => {
354354

355355
const handleCommandExecution = async (message) => {
356356
const execCommand = async (command, params) => {
357-
await RCInstance.execCommand({ command, params });
357+
await RCInstance.execCommand({ command, params, tmid: threadId });
358358
setFilteredCommands([]);
359359
};
360360

0 commit comments

Comments
 (0)