mirror of
https://github.com/NicolasConstant/sengi
synced 2025-02-01 19:16:52 +01:00
fix false positive notifications
This commit is contained in:
parent
7414539f09
commit
93947744be
@ -87,9 +87,10 @@ export class StreamingWrapper {
|
||||
}
|
||||
|
||||
private pullNewNotifications(){
|
||||
this.mastodonService.getNotifications(this.account, null, null, this.since_id, 10)
|
||||
this.mastodonService.getNotifications(this.account, null, this.since_id, null, 10)
|
||||
.then((notifications: Notification[]) => {
|
||||
notifications = notifications.sort((a, b) => a.id.localeCompare(b.id));
|
||||
//notifications = notifications.sort((a, b) => a.id.localeCompare(b.id));
|
||||
notifications = notifications.reverse();
|
||||
for (const n of notifications) {
|
||||
const update = new StatusUpdate();
|
||||
update.notification = n;
|
||||
|
@ -110,19 +110,23 @@ export class UserNotificationService {
|
||||
// });
|
||||
}
|
||||
|
||||
private soundJustPlayed = false;
|
||||
private playSoundNotification() {
|
||||
if(this.soundJustPlayed) return;
|
||||
|
||||
|
||||
|
||||
console.warn('play audio');
|
||||
|
||||
// let audio = new Audio();
|
||||
// audio.src = "assets/audio/exquisite.mp3";
|
||||
// audio.load();
|
||||
// audio.play();
|
||||
|
||||
this.sound.play();
|
||||
}
|
||||
|
||||
private processNewUpdate(account: AccountInfo, notification: StatusUpdate) {
|
||||
if(!notification && !notification.notification) return;
|
||||
|
||||
this.playSoundNotification();
|
||||
console.warn(account);
|
||||
console.warn(notification);
|
||||
|
||||
|
||||
if (notification.notification.type === 'mention') {
|
||||
this.processMentionsAndNotifications(account, [notification.notification], NotificationTypeEnum.UserMention);
|
||||
|
Loading…
x
Reference in New Issue
Block a user