bug fixed
This commit is contained in:
parent
55170ae702
commit
4debdf1ec9
|
@ -228,9 +228,18 @@ export class CommonApiService {
|
||||||
): Promise<{ accept: boolean; rejected: string[] }> {
|
): Promise<{ accept: boolean; rejected: string[] }> {
|
||||||
return new Promise<{ accept: boolean; rejected: string[] }>(
|
return new Promise<{ accept: boolean; rejected: string[] }>(
|
||||||
async (resolve, reject) => {
|
async (resolve, reject) => {
|
||||||
|
const mediaFiles = this.mediaFiles(files);
|
||||||
|
if (!mediaFiles) {
|
||||||
|
resolve({
|
||||||
|
accept: true,
|
||||||
|
rejected: undefined
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let accept = true;
|
let accept = true;
|
||||||
const rejected: string[] = [];
|
const rejected: string[] = [];
|
||||||
for (const file of files) {
|
for (const file of mediaFiles) {
|
||||||
const info = await MimeUtil.getMimeFromBlob(file);
|
const info = await MimeUtil.getMimeFromBlob(file);
|
||||||
// console.log('mime info', info);
|
// console.log('mime info', info);
|
||||||
if (
|
if (
|
||||||
|
|
|
@ -1140,13 +1140,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const mediaFiles = this.commonApiService.mediaFiles(
|
|
||||||
fileUploadItems.map(fui => fui.file)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!!mediaFiles) {
|
|
||||||
const fakeMedia = await this.commonApiService.checkInvalidMediaMimeForFileTalk(
|
const fakeMedia = await this.commonApiService.checkInvalidMediaMimeForFileTalk(
|
||||||
mediaFiles
|
fileUploadItems.map(fui => fui.file)
|
||||||
);
|
);
|
||||||
if (!fakeMedia.accept) {
|
if (!fakeMedia.accept) {
|
||||||
if (!!this.fileUploadQueue) {
|
if (!!this.fileUploadQueue) {
|
||||||
|
@ -1175,7 +1170,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (const fileUploadItem of fileUploadItems) {
|
for (const fileUploadItem of fileUploadItems) {
|
||||||
let thumbnail: File;
|
let thumbnail: File;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user