bug fixed

This commit is contained in:
richard-loafle 2020-02-14 16:12:38 +09:00
parent 55170ae702
commit 4debdf1ec9
2 changed files with 36 additions and 33 deletions

View File

@ -228,9 +228,18 @@ export class CommonApiService {
): Promise<{ accept: boolean; rejected: string[] }> {
return new Promise<{ accept: boolean; rejected: string[] }>(
async (resolve, reject) => {
const mediaFiles = this.mediaFiles(files);
if (!mediaFiles) {
resolve({
accept: true,
rejected: undefined
});
return;
}
let accept = true;
const rejected: string[] = [];
for (const file of files) {
for (const file of mediaFiles) {
const info = await MimeUtil.getMimeFromBlob(file);
// console.log('mime info', info);
if (

View File

@ -1140,13 +1140,8 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
return;
}
const mediaFiles = this.commonApiService.mediaFiles(
fileUploadItems.map(fui => fui.file)
);
if (!!mediaFiles) {
const fakeMedia = await this.commonApiService.checkInvalidMediaMimeForFileTalk(
mediaFiles
fileUploadItems.map(fui => fui.file)
);
if (!fakeMedia.accept) {
if (!!this.fileUploadQueue) {
@ -1175,7 +1170,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
return;
}
}
for (const fileUploadItem of fileUploadItems) {
let thumbnail: File;