@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/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/core/payload.d.ts +2 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/core/payload.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/@types/core/payload.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/channelRepository/events/onChannelSetMuted.d.ts.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/channelRepository/events/onChannelSetMuted.js +6 -8
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/dist/channelRepository/events/onChannelSetMuted.js.map +1 -1
- package/.rollup.cache/home/runner/work/AmityTypescriptSDK/AmityTypescriptSDK/packages/sdk/tsconfig.tsbuildinfo +1 -1
- package/dist/@types/core/payload.d.ts +2 -1
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelSetMuted.d.ts.map +1 -1
- package/dist/index.cjs.js +6 -8
- package/dist/index.esm.js +6 -8
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
- package/src/@types/core/payload.ts +2 -1
- package/src/channelRepository/events/onChannelSetMuted.ts +6 -8
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -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 (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
33
|
+
payload.channelId,
|
|
36
34
|
])?.data;
|
|
37
35
|
|
|
38
36
|
if (channel) {
|