Skip to content

Commit

Permalink
Improve: enable message sound
Browse files Browse the repository at this point in the history
  • Loading branch information
fs5m8 committed Dec 28, 2022
1 parent cec0fb0 commit 0479521
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/client/app/mios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { EventEmitter } from 'eventemitter3';
import { v4 as uuid } from 'uuid';

import initStore from './store';
import { apiUrl, version, locale } from './config';
import { url, apiUrl, version, locale } from './config';
import Progress from './common/scripts/loading';

import Err from './common/views/components/connect-failed.vue';
Expand Down Expand Up @@ -253,6 +253,11 @@ export default class MiOS extends EventEmitter {
this.store.dispatch('mergeMe', {
hasUnreadMessagingMessage: true
});
if (this.store.state.device.enableSounds && this.store.state.device.enableSoundsInMessage) {
const sound = new Audio(`${url}/assets/notify.mp3`);
sound.volume = this.store.state.device.soundVolume;
sound.play();
}
});

main.on('unreadMention', () => {
Expand Down

0 comments on commit 0479521

Please sign in to comment.