feat: SOME sorting

This commit is contained in:
not-nullptr 2025-04-14 23:30:31 +01:00
parent 2191c95500
commit ea53fc7b9b
1 changed files with 11 additions and 2 deletions

View File

@ -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",