Merge pull request #2780 from krille-chan/krille/bring-back-notification-sound
refactor: Bring back notification web sound but make configurable
This commit is contained in:
commit
0e77ce53ec
4 changed files with 18 additions and 2 deletions
|
|
@ -16,6 +16,10 @@ import 'package:matrix/matrix.dart';
|
|||
import 'package:universal_html/html.dart' as html;
|
||||
|
||||
extension LocalNotificationsExtension on MatrixState {
|
||||
static final html.AudioElement _audioPlayer = html.AudioElement()
|
||||
..src = 'assets/assets/sounds/notification.ogg'
|
||||
..load();
|
||||
|
||||
Future<void> showLocalNotification(Event event) async {
|
||||
final l10n = L10n.of(context);
|
||||
final roomId = event.room.id;
|
||||
|
|
@ -69,6 +73,8 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
);
|
||||
}
|
||||
|
||||
if (AppSettings.webNotificationSound.value) _audioPlayer.play();
|
||||
|
||||
html.Notification(
|
||||
title,
|
||||
body: body,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue