Enable the mobile ntoifications inside Ombi

This commit is contained in:
Jamie Rees 2018-05-02 13:21:33 +01:00
parent 5e25e16649
commit f426551222
3 changed files with 11 additions and 3 deletions

View file

@ -39,7 +39,7 @@ namespace Ombi.Notifications.Agents
protected override bool ValidateConfiguration(MobileNotificationSettings settings) protected override bool ValidateConfiguration(MobileNotificationSettings settings)
{ {
return false; return true;
} }
protected override async Task NewRequest(NotificationOptions model, MobileNotificationSettings settings) protected override async Task NewRequest(NotificationOptions model, MobileNotificationSettings settings)
@ -211,7 +211,7 @@ namespace Ombi.Notifications.Agents
protected async Task Send(List<string> playerIds, NotificationMessage model, MobileNotificationSettings settings) protected async Task Send(List<string> playerIds, NotificationMessage model, MobileNotificationSettings settings)
{ {
if (!playerIds.Any()) if (playerIds == null || !playerIds.Any())
{ {
return; return;
} }

View file

@ -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) { public onSubmit(form: FormGroup) {

View file

@ -54,6 +54,7 @@
<i class="fa fa-bell-o" aria-hidden="true"></i> Notifications <span class="caret"></span> <i class="fa fa-bell-o" aria-hidden="true"></i> Notifications <span class="caret"></span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Mobile']">Mobile</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Email']">Email</a></li> <li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Email']">Email</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/MassEmail']">Mass Email</a></li> <li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/MassEmail']">Mass Email</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Newsletter']">Newsletter</a></li> <li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Newsletter']">Newsletter</a></li>