@amityco/ts-sdk 7.7.1-1cf499d.0 → 7.7.1-3f344102.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.7.1-1cf499d.0",
3
+ "version": "7.7.1-3f344102.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -597,9 +597,10 @@ declare global {
597
597
  channelId: string;
598
598
  muteTimeout: Amity.timestamp;
599
599
  actor: string;
600
+ networkId: string;
600
601
  };
601
602
 
602
- type ChannelSetMutedPayload = RawChannelSetMuted[];
603
+ type ChannelSetMutedPayload = RawChannelSetMuted;
603
604
 
604
605
  type RawChannelSetUserMuted = {
605
606
  channelId: string;
@@ -20,19 +20,17 @@ export const onChannelSetMuted = (callback: Amity.Listener<Amity.StaticInternalC
20
20
  if (callbacks.length === 0) {
21
21
  const client = getActiveClient();
22
22
 
23
- const filter = async (payloads: Amity.ChannelSetMutedPayload) => {
24
- payloads.forEach(payload => {
25
- upsertInCache(['channel', 'get', payload.channelId], {
26
- // If muteTimeout > now => user is muted
27
- // Otherwise => user is unmuted
28
- isMuted: Date.parse(payload.muteTimeout) > Date.now(),
29
- });
23
+ const filter = async (payload: Amity.ChannelSetMutedPayload) => {
24
+ upsertInCache(['channel', 'get', payload.channelId], {
25
+ // If muteTimeout > now => user is muted
26
+ // Otherwise => user is unmuted
27
+ isMuted: Date.parse(payload.muteTimeout) > Date.now(),
30
28
  });
31
29
 
32
30
  const channel = pullFromCache<Amity.StaticInternalChannel>([
33
31
  'channel',
34
32
  'get',
35
- payloads[0].channelId,
33
+ payload.channelId,
36
34
  ])?.data;
37
35
 
38
36
  if (channel) {