mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-22 17:25:40 +03:00
Accept any file if supportedMediaTypes is undefined
This commit is contained in:
parent
bf693ab979
commit
35ef1b58cf
1 changed files with 3 additions and 3 deletions
|
@ -222,7 +222,7 @@ function Compose({
|
||||||
charactersReservedPerUrl,
|
charactersReservedPerUrl,
|
||||||
} = {},
|
} = {},
|
||||||
mediaAttachments: {
|
mediaAttachments: {
|
||||||
supportedMimeTypes = [],
|
supportedMimeTypes,
|
||||||
imageSizeLimit,
|
imageSizeLimit,
|
||||||
imageMatrixLimit,
|
imageMatrixLimit,
|
||||||
videoSizeLimit,
|
videoSizeLimit,
|
||||||
|
@ -588,7 +588,7 @@ function Compose({
|
||||||
alert(`Could not access the given attachment.`);
|
alert(`Could not access the given attachment.`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (!supportedMimeTypes.includes(file.type)) {
|
else if (supportedMimeTypes !== undefined && !supportedMimeTypes.includes(file.type)) {
|
||||||
alert(`Your instance does not allow attachments of type "${file.type}".`);
|
alert(`Your instance does not allow attachments of type "${file.type}".`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1262,7 +1262,7 @@ function Compose({
|
||||||
<label class="toolbar-button">
|
<label class="toolbar-button">
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
accept={supportedMimeTypes.join(',')}
|
accept={supportedMimeTypes?.join(',')}
|
||||||
multiple={mediaAttachments.length < maxMediaAttachments - 1}
|
multiple={mediaAttachments.length < maxMediaAttachments - 1}
|
||||||
disabled={
|
disabled={
|
||||||
uiState === 'loading' ||
|
uiState === 'loading' ||
|
||||||
|
|
Loading…
Reference in a new issue