Skip to content

armgit / VERT

Public Imported from GitHub
0

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

feat: SOME sorting

not-nullptrea53fc7b9ba8
diff --git a/src/routes/convert/+page.svelte b/src/routes/convert/+page.svelte
index 33932a0..1862d72 100644
--- a/src/routes/convert/+page.svelte
+++ b/src/routes/convert/+page.svelte
@@ -231,12 +231,21 @@
c.supportedFormats.find(
(f) => f.name === file.from,
)?.isNative
- ? c.formatStrings((f) => f.toSupported)
- : c.formatStrings(
+ ? c.supportedFormats.filter(
+ (f) => f.toSupported,
+ )
+ : c.supportedFormats.filter(
(f) =>
f.toSupported && f.isNative,
),
)
+ .sort((a, b) => {
+ // sort native formats first
+ if (a.isNative && !b.isNative) return -1;
+ if (!a.isNative && b.isNative) return 1;
+ return 0;
+ })
+ .map((f) => f.name)
.filter(
(format) =>
format !== ".svg" && format !== ".heif",