Skip to content

Commit fbf8ecb

Browse files
committed
fix: remove state checks from handleAppBackground
1 parent 1618cca commit fbf8ecb

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

package/src/components/Channel/Channel.tsx

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -674,22 +674,19 @@ const ChannelWithContext = <
674674
}
675675
};
676676

677-
const handleAppBackground = useCallback(
678-
(state) => {
679-
if (channel && (state === 'inactive' || state === 'background')) {
680-
channel.sendEvent({ parent_id: thread?.id, type: 'typing.stop' } as StreamEvent<
681-
At,
682-
Ch,
683-
Co,
684-
Ev,
685-
Me,
686-
Re,
687-
Us
688-
>);
689-
}
690-
},
691-
[thread?.id, channelId],
692-
);
677+
const handleAppBackground = useCallback(() => {
678+
if (channel) {
679+
channel.sendEvent({ parent_id: thread?.id, type: 'typing.stop' } as StreamEvent<
680+
At,
681+
Ch,
682+
Co,
683+
Ev,
684+
Me,
685+
Re,
686+
Us
687+
>);
688+
}
689+
}, [thread?.id, channelId]);
693690

694691
useAppStateListener(undefined, handleAppBackground);
695692

0 commit comments

Comments
 (0)