Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/strong-emus-exist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@audius/sdk': patch
---

Chat blast audienceContentType = track if remixer audience
26 changes: 16 additions & 10 deletions packages/libs/src/sdk/api/chats/ChatsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,16 @@ import {
TypedCommsResponse,
UnfurlResponse
} from './clientTypes'
import type {
ChatInvite,
UserChat,
ChatMessage,
ChatWebsocketEventData,
RPCPayloadRequest,
ValidatedChatPermissions,
ChatCreateRPC,
UpgradableChatBlast
import {
type ChatInvite,
type UserChat,
type ChatMessage,
type ChatWebsocketEventData,
type RPCPayloadRequest,
type ValidatedChatPermissions,
type ChatCreateRPC,
type UpgradableChatBlast,
ChatBlastAudience
} from './serverTypes'

const GENERIC_MESSAGE_ERROR = 'Error: this message cannot be displayed'
Expand Down Expand Up @@ -526,9 +527,14 @@ export class ChatsApi
message,
audience,
audienceContentId,
audienceContentType
audienceContentType: audienceContentTypeParam
} = await parseParams('messageBlast', ChatBlastMessageRequestSchema)(params)

let audienceContentType = audienceContentTypeParam
if (audience === ChatBlastAudience.REMIXERS && !!audienceContentId) {
audienceContentType = 'track'
}

return await this.sendRpc({
current_user_id: currentUserId,
method: 'chat.blast',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ export const ChatBlastModal = () => {
values.target_audience === ChatBlastAudience.CUSTOMERS
? values.purchased_content_metadata?.contentId
: values.remixed_track_id
const audienceContentType =
values.target_audience === ChatBlastAudience.REMIXERS
? 'track'
: values.purchased_content_metadata?.contentType
dispatch(
createChatBlast({
audience: values.target_audience,
audienceContentId,
audienceContentType: values.purchased_content_metadata?.contentType
audienceContentType
})
)
}
Expand Down