X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-custom-markup%2Fcustom-markup.service.ts;h=a959b336d18b555619dbdddbf9b29b85cacefbd1;hb=082d32eb8873190e48329b61b91f87d71f3cf812;hp=231e52d0a57d8c74b96c78fdfbd14c4fbb8e2fd6;hpb=674d903b0e993b3a67836f3dabba80282d9900ab;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts index 231e52d0a..a959b336d 100644 --- a/client/src/app/shared/shared-custom-markup/custom-markup.service.ts +++ b/client/src/app/shared/shared-custom-markup/custom-markup.service.ts @@ -1,4 +1,4 @@ -import { first } from 'rxjs/operators' +import { firstValueFrom } from 'rxjs' import { ComponentRef, Injectable } from '@angular/core' import { MarkdownService } from '@app/core' import { @@ -7,7 +7,6 @@ import { ContainerMarkupData, EmbedMarkupData, PlaylistMiniatureMarkupData, - VideoFilter, VideoMiniatureMarkupData, VideosListMarkupData } from '@shared/models' @@ -65,15 +64,15 @@ export class CustomMarkupService { for (const selector of Object.keys(this.htmlBuilders)) { rootElement.querySelectorAll(selector) - .forEach((e: HTMLElement) => { - try { - const element = this.execHTMLBuilder(selector, e) - // Insert as first child - e.insertBefore(element, e.firstChild) - } catch (err) { - console.error('Cannot inject component %s.', selector, err) - } - }) + .forEach((e: HTMLElement) => { + try { + const element = this.execHTMLBuilder(selector, e) + // Insert as first child + e.insertBefore(element, e.firstChild) + } catch (err) { + console.error('Cannot inject component %s.', selector, err) + } + }) } const loadedPromises: Promise[] = [] @@ -85,7 +84,7 @@ export class CustomMarkupService { const component = this.execAngularBuilder(selector, e) if (component.instance.loaded) { - const p = component.instance.loaded.pipe(first()).toPromise() + const p = firstValueFrom(component.instance.loaded) loadedPromises.push(p) } @@ -191,7 +190,9 @@ export class CustomMarkupService { accountHandle: data.accountHandle || undefined, channelHandle: data.channelHandle || undefined, - filter: this.buildBoolean(data.onlyLocal) ? 'local' as VideoFilter : undefined + isLive: this.buildBoolean(data.isLive), + + isLocal: this.buildBoolean(data.onlyLocal) ? true : undefined } this.dynamicElementService.setModel(component, model) @@ -215,6 +216,8 @@ export class CustomMarkupService { root.classList.add('peertube-container', layoutClass) + root.style.justifyContent = data.justifyContent || 'space-between' + if (data.width) { root.setAttribute('width', data.width) }