mirror of https://github.com/VERT-sh/VERT.git
fix: don't allow converting to same format
This commit is contained in:
parent
f16a12f1c0
commit
95d57a0427
|
@ -67,17 +67,16 @@
|
|||
<div class="flex items-center gap-2">
|
||||
<p class="whitespace-nowrap text-xl">Set all to</p>
|
||||
{#if files.requiredConverters.length === 1}
|
||||
<!-- cannot convert to svg or heif -->
|
||||
{@const supported = files.files[0]?.converters
|
||||
.flatMap((c) => c.formatStrings((f) => f.toSupported))
|
||||
?.filter(
|
||||
(format) => format !== ".svg" && format !== ".heif",
|
||||
)}
|
||||
{@const supported = files.files[0]?.converters.flatMap((c) =>
|
||||
c.formatStrings((f) => f.toSupported),
|
||||
)}
|
||||
<Dropdown
|
||||
onselect={(r) =>
|
||||
files.files.forEach((f) => {
|
||||
f.to = r;
|
||||
f.result = null;
|
||||
if (f.from !== r) {
|
||||
f.to = r;
|
||||
f.result = null;
|
||||
}
|
||||
})}
|
||||
options={supported || []}
|
||||
/>
|
||||
|
|
|
@ -167,7 +167,8 @@
|
|||
We can't convert this file.
|
||||
</p>
|
||||
<p class="font-normal">
|
||||
Only image, video, audio, and document files are supported
|
||||
Only image, video, audio, and document files are
|
||||
supported
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -229,10 +230,7 @@
|
|||
.flatMap((c) =>
|
||||
c.formatStrings((f) => f.toSupported),
|
||||
)
|
||||
.filter(
|
||||
(format) =>
|
||||
format !== ".svg" && format !== ".heif",
|
||||
) || []}
|
||||
.filter((format) => format !== file.from) || []}
|
||||
bind:selected={file.to}
|
||||
onselect={(option) => handleSelect(option, file)}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue