Remove unnecessary workarounds
Has been fixed upstream
This commit is contained in:
parent
3193ac2c3b
commit
f9ac050a35
|
@ -3,7 +3,6 @@ import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/h
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
import { AuthService, Notifier, ServerService } from '@app/core'
|
import { AuthService, Notifier, ServerService } from '@app/core'
|
||||||
import { BytesPipe, VideoService } from '@app/shared/shared-main'
|
import { BytesPipe, VideoService } from '@app/shared/shared-main'
|
||||||
import { isIOS } from '@root-helpers/web-browser'
|
|
||||||
import { HttpStatusCode } from '@shared/models'
|
import { HttpStatusCode } from '@shared/models'
|
||||||
import { UploaderXFormData } from './uploaderx-form-data'
|
import { UploaderXFormData } from './uploaderx-form-data'
|
||||||
|
|
||||||
|
@ -64,17 +63,11 @@ export class VideoUploadService {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getUploadxOptions (endpoint: string, uploaderClass: typeof UploaderXFormData) {
|
private getUploadxOptions (endpoint: string, uploaderClass: typeof UploaderXFormData) {
|
||||||
// FIXME: https://github.com/Chocobozzz/PeerTube/issues/4382#issuecomment-915854167
|
|
||||||
const chunkSize = isIOS()
|
|
||||||
? 0
|
|
||||||
: undefined // Auto chunk size
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
endpoint,
|
endpoint,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
|
|
||||||
maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize,
|
maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize,
|
||||||
chunkSize,
|
|
||||||
|
|
||||||
token: this.authService.getAccessToken(),
|
token: this.authService.getAccessToken(),
|
||||||
|
|
||||||
|
|
|
@ -158,8 +158,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'uploading':
|
case 'uploading':
|
||||||
// TODO: remove || 0 when // https://github.com/kukhariev/ngx-uploadx/pull/368 is released
|
this.videoUploadPercents = state.progress
|
||||||
this.videoUploadPercents = state.progress || 0
|
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'paused':
|
case 'paused':
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { AfterContentInit, ChangeDetectorRef, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
|
import { AfterContentInit, Component, ContentChildren, forwardRef, Input, QueryList, TemplateRef } from '@angular/core'
|
||||||
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
|
||||||
import { PeerTubeTemplateDirective } from '@app/shared/shared-main'
|
import { PeerTubeTemplateDirective } from '@app/shared/shared-main'
|
||||||
|
|
||||||
|
@ -25,14 +25,9 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
|
||||||
|
|
||||||
@ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>>
|
@ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>>
|
||||||
|
|
||||||
// FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836
|
|
||||||
@Input() onPushWorkaround = false
|
|
||||||
|
|
||||||
labelTemplate: TemplateRef<any>
|
labelTemplate: TemplateRef<any>
|
||||||
helpTemplate: TemplateRef<any>
|
helpTemplate: TemplateRef<any>
|
||||||
|
|
||||||
constructor (private cdr: ChangeDetectorRef) { }
|
|
||||||
|
|
||||||
ngAfterContentInit () {
|
ngAfterContentInit () {
|
||||||
{
|
{
|
||||||
const t = this.templates.find(t => t.name === 'label')
|
const t = this.templates.find(t => t.name === 'label')
|
||||||
|
@ -49,10 +44,6 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
|
||||||
|
|
||||||
writeValue (checked: boolean) {
|
writeValue (checked: boolean) {
|
||||||
this.checked = checked
|
this.checked = checked
|
||||||
|
|
||||||
if (this.onPushWorkaround) {
|
|
||||||
this.cdr.markForCheck()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registerOnChange (fn: (_: any) => void) {
|
registerOnChange (fn: (_: any) => void) {
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
<button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)">
|
<button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
[disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)"
|
[disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)"
|
||||||
[ngModel]="isPrimaryCheckboxChecked(playlist)" [onPushWorkaround]="true"
|
[ngModel]="isPrimaryCheckboxChecked(playlist)"
|
||||||
></my-peertube-checkbox>
|
></my-peertube-checkbox>
|
||||||
|
|
||||||
<label [for]="getPrimaryInputName(playlist)" class="display-name">
|
<label [for]="getPrimaryInputName(playlist)" class="display-name">
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
<ng-container *ngFor="let element of buildOptionalRowElements(playlist)">
|
<ng-container *ngFor="let element of buildOptionalRowElements(playlist)">
|
||||||
<my-peertube-checkbox
|
<my-peertube-checkbox
|
||||||
[inputName]="getOptionalInputName(playlist, element)"
|
[inputName]="getOptionalInputName(playlist, element)"
|
||||||
[ngModel]="element.enabled" [onPushWorkaround]="true"
|
[ngModel]="element.enabled"
|
||||||
(click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)"
|
(click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)"
|
||||||
></my-peertube-checkbox>
|
></my-peertube-checkbox>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user