Fix upload error handling

pull/5386/head
Chocobozzz 2022-10-28 11:19:45 +02:00
parent 37ff5005b4
commit 672e185bf3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 3 additions and 11 deletions

View File

@ -76,10 +76,8 @@
</div>
</div>
<div class="btn-group" role="group">
<input type="button" class="btn" i18n-value="Retry failed upload of a video" value="Retry" (click)="retryUpload()" />
<input type="button" class="btn" i18n-value="Cancel ongoing upload of a video" value="Cancel" (click)="cancelUpload()" />
</div>
<input type="button" class="peertube-button grey-button ms-1" i18n-value="Retry failed upload of a video" value="Retry" (click)="retryUpload()" />
<input type="button" class="peertube-button grey-button ms-1" i18n-value="Cancel ongoing upload of a video" value="Cancel" (click)="cancelUpload()" />
</div>
<div *ngIf="error && !enableRetryAfterError" class="alert alert-danger">

View File

@ -42,10 +42,4 @@
}
}
}
input {
@include peertube-button;
@include grey-button;
@include margin-left(10px);
}
}

View File

@ -136,7 +136,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
onUploadVideoOngoing (state: UploadState) {
switch (state.status) {
case 'error': {
if (!this.alreadyRefreshedToken && state.response.status === HttpStatusCode.UNAUTHORIZED_401) {
if (!this.alreadyRefreshedToken && state.responseStatus === HttpStatusCode.UNAUTHORIZED_401) {
this.alreadyRefreshedToken = true
return this.refereshTokenAndRetryUpload()