Remove unnecessary workarounds

Has been fixed upstream
This commit is contained in:
Chocobozzz 2023-07-28 15:43:09 +02:00
parent 3193ac2c3b
commit f9ac050a35
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 4 additions and 21 deletions

View File

@ -3,7 +3,6 @@ import { HttpErrorResponse, HttpEventType, HttpHeaders } from '@angular/common/h
import { Injectable } from '@angular/core'
import { AuthService, Notifier, ServerService } from '@app/core'
import { BytesPipe, VideoService } from '@app/shared/shared-main'
import { isIOS } from '@root-helpers/web-browser'
import { HttpStatusCode } from '@shared/models'
import { UploaderXFormData } from './uploaderx-form-data'
@ -64,17 +63,11 @@ export class VideoUploadService {
}
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 {
endpoint,
multiple: false,
maxChunkSize: this.server.getHTMLConfig().client.videos.resumableUpload.maxChunkSize,
chunkSize,
token: this.authService.getAccessToken(),

View File

@ -158,8 +158,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
break
case 'uploading':
// TODO: remove || 0 when // https://github.com/kukhariev/ngx-uploadx/pull/368 is released
this.videoUploadPercents = state.progress || 0
this.videoUploadPercents = state.progress
break
case 'paused':

View File

@ -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 { PeerTubeTemplateDirective } from '@app/shared/shared-main'
@ -25,14 +25,9 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
@ContentChildren(PeerTubeTemplateDirective) templates: QueryList<PeerTubeTemplateDirective<'label' | 'help'>>
// FIXME: https://github.com/angular/angular/issues/10816#issuecomment-307567836
@Input() onPushWorkaround = false
labelTemplate: TemplateRef<any>
helpTemplate: TemplateRef<any>
constructor (private cdr: ChangeDetectorRef) { }
ngAfterContentInit () {
{
const t = this.templates.find(t => t.name === 'label')
@ -49,10 +44,6 @@ export class PeertubeCheckboxComponent implements ControlValueAccessor, AfterCon
writeValue (checked: boolean) {
this.checked = checked
if (this.onPushWorkaround) {
this.cdr.markForCheck()
}
}
registerOnChange (fn: (_: any) => void) {

View File

@ -17,7 +17,7 @@
<button class="primary-row button-unstyle" (click)="toggleMainPlaylist($event, playlist)">
<my-peertube-checkbox
[disabled]="isPresentMultipleTimes(playlist) || playlist.optionalRowDisplayed" [inputName]="getPrimaryInputName(playlist)"
[ngModel]="isPrimaryCheckboxChecked(playlist)" [onPushWorkaround]="true"
[ngModel]="isPrimaryCheckboxChecked(playlist)"
></my-peertube-checkbox>
<label [for]="getPrimaryInputName(playlist)" class="display-name">
@ -36,7 +36,7 @@
<ng-container *ngFor="let element of buildOptionalRowElements(playlist)">
<my-peertube-checkbox
[inputName]="getOptionalInputName(playlist, element)"
[ngModel]="element.enabled" [onPushWorkaround]="true"
[ngModel]="element.enabled"
(click)="toggleOptionalPlaylist($event, playlist, element, startAt.timestamp, stopAt.timestamp)"
></my-peertube-checkbox>