Streaming: play chat sounds if enabled
This commit is contained in:
parent
6c22a3841b
commit
ac4ffaa41f
1 changed files with 6 additions and 3 deletions
|
@ -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…
Reference in a new issue