by Guest » 12 Jan 2025, 11:33
Befolgen Sie die Anweisungen in ihrem Dokument, um meine eigene benutzerdefinierte Nachrichtenaktion hinzuzufügen, schien aber nicht zu funktionieren.
Code: Select all
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);
}
Befolgen Sie die Anweisungen in ihrem Dokument, um meine eigene benutzerdefinierte Nachrichtenaktion hinzuzufügen, schien aber nicht zu funktionieren.
[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]