getStream Chat custom Message Actions

Discussão em 'Angular' iniciado por Calvin Seng, Janeiro 12, 2025.

  1. Calvin Seng

    Calvin Seng Guest

    Following what their doc on https://getstream.io/chat/docs/sdk/angular/components/MessageActionsBoxComponent/ to add my own custom message action but didn't seem to work, hoping someone can help me out


    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);
    }

    Continue reading...

Compartilhe esta Página