From f4265512221e7dcfb6a427764d9ce7e7dae6275c Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Wed, 2 May 2018 13:21:33 +0100 Subject: [PATCH] Enable the mobile ntoifications inside Ombi --- src/Ombi.Notifications/Agents/MobileNotification.cs | 4 ++-- .../app/settings/notifications/mobile.component.ts | 9 ++++++++- .../ClientApp/app/settings/settingsmenu.component.html | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Ombi.Notifications/Agents/MobileNotification.cs b/src/Ombi.Notifications/Agents/MobileNotification.cs index 05c02dfef..575801bd2 100644 --- a/src/Ombi.Notifications/Agents/MobileNotification.cs +++ b/src/Ombi.Notifications/Agents/MobileNotification.cs @@ -39,7 +39,7 @@ namespace Ombi.Notifications.Agents protected override bool ValidateConfiguration(MobileNotificationSettings settings) { - return false; + return true; } protected override async Task NewRequest(NotificationOptions model, MobileNotificationSettings settings) @@ -211,7 +211,7 @@ namespace Ombi.Notifications.Agents protected async Task Send(List playerIds, NotificationMessage model, MobileNotificationSettings settings) { - if (!playerIds.Any()) + if (playerIds == null || !playerIds.Any()) { return; } diff --git a/src/Ombi/ClientApp/app/settings/notifications/mobile.component.ts b/src/Ombi/ClientApp/app/settings/notifications/mobile.component.ts index 4c78f462b..47ad3a25b 100644 --- a/src/Ombi/ClientApp/app/settings/notifications/mobile.component.ts +++ b/src/Ombi/ClientApp/app/settings/notifications/mobile.component.ts @@ -30,7 +30,14 @@ export class MobileComponent implements OnInit { }); }); - this.mobileService.getUserDeviceList().subscribe(x => this.userList = x); + this.mobileService.getUserDeviceList().subscribe(x => { + if(x.length <= 0) { + this.userList = []; + this.userList.push({username:"None",devices:0}); + } else { + this.userList = x; + } + }); } public onSubmit(form: FormGroup) { diff --git a/src/Ombi/ClientApp/app/settings/settingsmenu.component.html b/src/Ombi/ClientApp/app/settings/settingsmenu.component.html index 246760f26..6c6bb5c3f 100644 --- a/src/Ombi/ClientApp/app/settings/settingsmenu.component.html +++ b/src/Ombi/ClientApp/app/settings/settingsmenu.component.html @@ -54,6 +54,7 @@ Notifications