From 9556ce48e7d0aaed35753d982327bc60e1284894 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 25 Feb 2021 09:09:41 +0100 Subject: Fix async issues with channels list --- .../app/+videos/+video-edit/video-add-components/video-send.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'client/src/app/+videos') diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts index 9a22024e5..3614499cd 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-send.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-send.ts @@ -2,7 +2,7 @@ import { catchError, switchMap, tap } from 'rxjs/operators' import { SelectChannelItem } from 'src/types/select-options-item.model' import { Directive, EventEmitter, OnInit } from '@angular/core' import { AuthService, CanComponentDeactivateResult, Notifier, ServerService } from '@app/core' -import { populateAsyncUserVideoChannels } from '@app/helpers' +import { listUserChannels } from '@app/helpers' import { FormReactive } from '@app/shared/shared-forms' import { VideoCaptionEdit, VideoCaptionService, VideoEdit, VideoService } from '@app/shared/shared-main' import { LoadingBarService } from '@ngx-loading-bar/core' @@ -35,8 +35,11 @@ export abstract class VideoSend extends FormReactive implements OnInit { ngOnInit () { this.buildForm({}) - populateAsyncUserVideoChannels(this.authService, this.userVideoChannels) - .then(() => this.firstStepChannelId = this.userVideoChannels[ 0 ].id) + listUserChannels(this.authService) + .subscribe(channels => { + this.userVideoChannels = channels + this.firstStepChannelId = this.userVideoChannels[0].id + }) this.serverConfig = this.serverService.getTmpConfig() this.serverService.getConfig() -- cgit v1.2.3