Anonymous
GetStream Chat пользовательские действия с сообщениями
Сообщение
Anonymous » 12 янв 2025, 12:58
Следуя их документу на
https://getstream.io/chat/docs/sdk/angu ... Component/ , я добавил свое собственное действие с сообщением, но, похоже, оно не сработало, надеясь, что кто-нибудь сможет мне помочь< /p>
Код: Выделить всё
import {
StreamMessage,
CustomMessageActionItem,
DefaultStreamChatGenerics
} from "stream-chat-angular";
customActions: CustomMessageActionItem[] = [
{
actionName: 'custom-action',
actionLabelOrTranslationKey: 'Custom Action',
actionHandler: (message: StreamMessage) => {
console.log('Custom action executed for:', message);
},
isVisible: (enabledActions: string[]) => {
return enabledActions.includes('custom-action');
},
}
];
ngAfterViewInit(): void {
this.messageActionsService.customActions$.next(this.customActions);
}
Подробнее здесь:
https://stackoverflow.com/questions/793 ... ge-actions
1736675921
Anonymous
Следуя их документу на https://getstream.io/chat/docs/sdk/angular/comComponents/MessageActionsBoxComponent/, я добавил свое собственное действие с сообщением, но, похоже, оно не сработало, надеясь, что кто-нибудь сможет мне помочь< /p> [code]import { StreamMessage, CustomMessageActionItem, DefaultStreamChatGenerics } from "stream-chat-angular"; customActions: CustomMessageActionItem[] = [ { actionName: 'custom-action', actionLabelOrTranslationKey: 'Custom Action', actionHandler: (message: StreamMessage) => { console.log('Custom action executed for:', message); }, isVisible: (enabledActions: string[]) => { return enabledActions.includes('custom-action'); }, } ]; ngAfterViewInit(): void { this.messageActionsService.customActions$.next(this.customActions); }[/code] Подробнее здесь: [url]https://stackoverflow.com/questions/79349695/getstream-chat-custom-message-actions[/url]