Streaming: play chat sounds if enabled

environments/review-chats-g56n7m/deployments/1665
Alex Gleason 2 years ago
parent 6c22a3841b
commit ac4ffaa41f
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -4,7 +4,7 @@ import { ChatKeys, IChat, isLastMessage } from 'soapbox/queries/chats';
import { queryClient } from 'soapbox/queries/client';
import { updateChatListItem } from 'soapbox/utils/chats';
import { removePageItem } from 'soapbox/utils/queries';
// import { play, soundCache } from 'soapbox/utils/sounds';
import { play, soundCache } from 'soapbox/utils/sounds';
import { connectStream } from '../stream';
@ -136,12 +136,15 @@ const connectTimelineStream = (
const chat = JSON.parse(data.payload);
const me = getState().me;
const messageOwned = chat.last_message?.account_id === me;
const settings = getSettings(getState());
// Don't update own messages from streaming
if (!messageOwned) {
updateChatListItem(chat);
// Temp disable until we support disabling/enabling.
// play(soundCache.chat);
if (settings.getIn(['chats', 'sound'])) {
play(soundCache.chat);
}
}
});
break;

Loading…
Cancel
Save