Skip to content

Commit

Permalink
fix: don't expose ChannelManagerOptions to integrators
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed Feb 28, 2025
1 parent 70bffdf commit fcb5d3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
7 changes: 0 additions & 7 deletions projects/stream-chat-angular/src/lib/channel.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {
Channel,
ChannelManager,
ChannelManagerEventHandlerOverrides,
ChannelManagerOptions,
Event,
FormatMessageResponse,
MemberFilters,
Expand Down Expand Up @@ -593,7 +592,6 @@ export class ChannelService<
this.customChannelQuery = query;
this.createChannelManager({
eventHandlerOverrides,
options: managerOptions,
});

return this._init(options);
Expand Down Expand Up @@ -1867,7 +1865,6 @@ export class ChannelService<

this.createChannelManager({
eventHandlerOverrides,
options: managerOptions,
});

this.clientEventsSubscription = this.chatClientService.events$.subscribe(
Expand All @@ -1878,21 +1875,17 @@ export class ChannelService<

private createChannelManager({
eventHandlerOverrides,
options,
}: {
eventHandlerOverrides?: ChannelManagerEventHandlerOverrides<T>;
options?: ChannelManagerOptions;
}) {
this.channelManager = new ChannelManager({
client: this.chatClientService.chatClient,
options: {
...options,
allowNotLoadedChannelPromotionForEvent: {
'message.new': false,
'channel.visible': true,
'notification.added_to_channel': true,
'notification.message_new': true,
...options?.allowNotLoadedChannelPromotionForEvent,
},
},
eventHandlerOverrides,
Expand Down
4 changes: 2 additions & 2 deletions projects/stream-chat-angular/src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type {
Channel,
ChannelFilters,
ChannelManagerEventHandlerOverrides,
ChannelManagerOptions,
ChannelMemberResponse,
ChannelOptions,
ChannelSort,
Expand Down Expand Up @@ -551,9 +550,10 @@ export type MessageTextContext = {
shouldTranslate: boolean;
};

// TODO: add ChannelManagerOptions once it's stable
export type ChannelServiceOptions<
T extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,
> = ChannelManagerOptions & {
> = {
shouldSetActiveChannel?: boolean;
eventHandlerOverrides?: ChannelManagerEventHandlerOverrides<T>;
};
Expand Down

0 comments on commit fcb5d3b

Please sign in to comment.