]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Remove unnecessary workarounds
authorChocobozzz <me@florianbigard.com>
Fri, 28 Jul 2023 13:43:09 +0000 (15:43 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 28 Jul 2023 13:46:14 +0000 (15:46 +0200)
Has been fixed upstream

client/src/app/+videos/+video-edit/shared/video-upload.service.ts
client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts
client/src/app/shared/shared-forms/peertube-checkbox.component.ts
client/src/app/shared/shared-video-playlist/video-add-to-playlist.component.html

index cb95035039f0178ea21e2c564c011313fda57c08..50ca1a60be89852e84a9774c71efda34458636e2 100644 (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(),
 
index cfa42910b982327f9cf768376f79d0ca90113fe5..f7e1872a5dee63c51a194f61e0f5b6e5fa0b9ba0 100644 (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':
index 76ef77e5ab09e8dd909ec8692614d03a6d73d390..f71eb3d34ed1f90fae25fd805ee3dbda1bfe27cf 100644 (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) {
index f2f69236c79a82ec82a545807a518fc0195ec09c..4aaccd50d08d850bd5320fe527f2128ef8ca0e31 100644 (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>