fix: fixes the behavior of the alsoSendThreadToChannel property (#5573)
This commit is contained in:
parent
e55b172bc1
commit
1beb0d0efa
|
@ -66,8 +66,13 @@ export const MessageComposer = ({
|
|||
const showEmojiKeyboard = useShowEmojiKeyboard();
|
||||
const showEmojiSearchbar = useShowEmojiSearchbar();
|
||||
const alsoSendThreadToChannel = useAlsoSendThreadToChannel();
|
||||
const { openSearchEmojiKeyboard, closeEmojiKeyboard, closeSearchEmojiKeyboard, setTrackingViewHeight } =
|
||||
useMessageComposerApi();
|
||||
const {
|
||||
openSearchEmojiKeyboard,
|
||||
closeEmojiKeyboard,
|
||||
closeSearchEmojiKeyboard,
|
||||
setTrackingViewHeight,
|
||||
setAlsoSendThreadToChannel
|
||||
} = useMessageComposerApi();
|
||||
const recordingAudio = useRecordingAudio();
|
||||
useKeyboardListener(trackingViewRef);
|
||||
|
||||
|
@ -101,6 +106,10 @@ export const MessageComposer = ({
|
|||
const handleSendMessage = async () => {
|
||||
if (!rid) return;
|
||||
|
||||
if (alsoSendThreadToChannel) {
|
||||
setAlsoSendThreadToChannel(false);
|
||||
}
|
||||
|
||||
if (sharing) {
|
||||
onSendMessage?.();
|
||||
return;
|
||||
|
|
|
@ -51,8 +51,7 @@ export const SendThreadToChannel = (): React.ReactElement | null => {
|
|||
* */
|
||||
if (alsoSendThreadToChannelUserPref === 'default') {
|
||||
const db = database.active;
|
||||
const observable = db.get('threads').query(Q.where('tmid', tmid)).observe();
|
||||
|
||||
const observable = db.get('threads').query(Q.where('id', tmid)).observe();
|
||||
subscription.current = observable.subscribe(result => {
|
||||
setAlsoSendThreadToChannel(!result.length);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue