Update server-discovery.component.ts

This commit is contained in:
piotrpekala7 2020-09-29 15:07:36 +02:00
parent c11d32e253
commit e16152edaf

View File

@ -9,6 +9,7 @@ import { Version } from '../../../models/version';
import { forkJoin } from 'rxjs';
import { ServerService } from '../../../services/server.service';
import { ServerDatabase } from '../../../services/server.database';
import { from } from 'rxjs';
@Component({
selector: 'app-server-discovery',
@ -43,8 +44,8 @@ export class ServerDiscoveryComponent implements OnInit {
discoverFirstAvailableServer() {
forkJoin(
Observable.fromPromise(this.serverService.findAll()).pipe(map((s: Server[]) => s)),
this.discovery()
[from(this.serverService.findAll()).pipe(map((s: Server[]) => s)),
this.discovery()]
).subscribe(([local, discovered]) => {
local.forEach(added => {
discovered = discovered.filter(server => {