mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor StatusPageSubscriberService to fix issue with sending notifications for unsubscribed subscribers
This commit is contained in:
parent
1affe3cdda
commit
d619d2afff
@ -319,6 +319,7 @@ export class Service extends DatabaseService<Model> {
|
||||
statusPage: StatusPage;
|
||||
eventType: StatusPageEventType;
|
||||
}): boolean {
|
||||
|
||||
let shouldSendNotification: boolean = true; // default to true.
|
||||
|
||||
if (data.subscriber.isUnsubscribed) {
|
||||
@ -341,7 +342,7 @@ export class Service extends DatabaseService<Model> {
|
||||
let shouldSendNotificationForResource: boolean = false;
|
||||
|
||||
if (subscriberResourceIds.length === 0) {
|
||||
shouldSendNotificationForResource = true;
|
||||
shouldSendNotificationForResource = false;
|
||||
} else {
|
||||
for (const resource of data.statusPageResources) {
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user