按照Stream Chat Angular文档添加自定义消息操作未生效的问题求助
Stream Chat Angular文档添加自定义消息操作未生效的问题求助
我按照Stream Chat Angular的官方文档步骤来添加自定义消息操作,但试了好几次都没生效,有没有大佬能帮我看看哪里出问题了?
我写的代码如下:
import { StreamMessage, CustomMessageActionItem, DefaultStreamChatGenerics } from "stream-chat-angular"; customActions: CustomMessageActionItem<DefaultStreamChatGenerics>[] = [ { actionName: 'custom-action', actionLabelOrTranslationKey: 'Custom Action', actionHandler: (message: StreamMessage<DefaultStreamChatGenerics>) => { console.log('Custom action executed for:', message); }, isVisible: (enabledActions: string[]) => { return enabledActions.includes('custom-action'); }, } ]; ngAfterViewInit(): void { this.messageActionsService.customActions$.next(this.customActions); }
我已经在ngAfterViewInit里通过messageActionsService把自定义操作推送到customActions$流里了,但消息的操作菜单里就是看不到我加的这个“Custom Action”,也不会触发对应的控制台日志。有没有人遇到过类似的问题,或者能帮我排查下哪里写错了?
备注:内容来源于stack exchange,提问作者Calvin Seng
相关产品推荐
相关产品推荐

