Skip to content

armgit / VERT

Public Imported from GitHub
0

The next-generation file converter. Open source, fully local* and free forever.

fix: don't allow converting to same format

JovannMC95d57a0427e3
diff --git a/src/lib/components/functional/ConversionPanel.svelte b/src/lib/components/functional/ConversionPanel.svelte
index 49f7eaf..ecf80d1 100644
--- a/src/lib/components/functional/ConversionPanel.svelte
+++ b/src/lib/components/functional/ConversionPanel.svelte
@@ -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 || []}
/>
diff --git a/src/routes/convert/+page.svelte b/src/routes/convert/+page.svelte
index eafda10..c284cea 100644
--- a/src/routes/convert/+page.svelte
+++ b/src/routes/convert/+page.svelte
@@ -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)}
/>