enhance: Push notification of Antenna note (#9338)
* wip
* wip
* wip
* fix
* fix
* 🎨
This commit is contained in:
parent
c5179e8f1c
commit
867e31c9ff
9 changed files with 104 additions and 24 deletions
|
@ -12,6 +12,7 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
|||
import { NotificationService } from './NotificationService.js';
|
||||
import { AntennaService } from './AntennaService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { PushNotificationService } from './PushNotificationService.js';
|
||||
|
||||
@Injectable()
|
||||
export class NoteReadService {
|
||||
|
@ -42,6 +43,7 @@ export class NoteReadService {
|
|||
private globalEventServie: GlobalEventService,
|
||||
private notificationService: NotificationService,
|
||||
private antennaService: AntennaService,
|
||||
private pushNotificationService: PushNotificationService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -205,12 +207,14 @@ export class NoteReadService {
|
|||
|
||||
if (count === 0) {
|
||||
this.globalEventServie.publishMainStream(userId, 'readAntenna', antenna);
|
||||
this.pushNotificationService.pushNotification(userId, 'readAntenna', { antennaId: antenna.id });
|
||||
}
|
||||
}
|
||||
|
||||
this.userEntityService.getHasUnreadAntenna(userId).then(unread => {
|
||||
if (!unread) {
|
||||
this.globalEventServie.publishMainStream(userId, 'readAllAntennas');
|
||||
this.pushNotificationService.pushNotification(userId, 'readAllAntennas', undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue