mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
better toasts
This commit is contained in:
@@ -2,7 +2,7 @@ import { HttpEventType } from '@angular/common/http';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FileSystemFileEntry, NgxFileDropEntry } from 'ngx-file-drop';
|
||||
import { DocumentService } from 'src/app/services/rest/document.service';
|
||||
import { Toast, ToastService } from 'src/app/services/toast.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
|
||||
interface UploadStatus {
|
||||
@@ -60,7 +60,7 @@ export class UploadFileWidgetComponent implements OnInit {
|
||||
} else if (event.type == HttpEventType.Response) {
|
||||
this.uploadStatus.splice(this.uploadStatus.indexOf(uploadStatusObject), 1)
|
||||
this.completedFiles += 1
|
||||
this.toastService.showToast(Toast.make("Information", $localize`The document has been uploaded and will be processed by the consumer shortly.`))
|
||||
this.toastService.showInfo($localize`The document has been uploaded and will be processed by the consumer shortly.`)
|
||||
}
|
||||
|
||||
}, error => {
|
||||
@@ -68,11 +68,11 @@ export class UploadFileWidgetComponent implements OnInit {
|
||||
this.completedFiles += 1
|
||||
switch (error.status) {
|
||||
case 400: {
|
||||
this.toastService.showToast(Toast.makeError($localize`There was an error while uploading the document: ${error.error.document}`))
|
||||
this.toastService.showInfo($localize`There was an error while uploading the document: ${error.error.document}`)
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.toastService.showToast(Toast.makeError($localize`An error has occurred while uploading the document. Sorry!`))
|
||||
this.toastService.showInfo($localize`An error has occurred while uploading the document. Sorry!`)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user