+ return
}
diff --git a/frontend/src/components/Sort.tsx b/frontend/src/components/Sort.tsx
index 593f647a2..27a4d9b20 100644
--- a/frontend/src/components/Sort.tsx
+++ b/frontend/src/components/Sort.tsx
@@ -18,9 +18,9 @@ export function produceSortFunction(sortMode: SortMode): (a: TerseScratch, b: Te
case SortMode.LAST_UPDATED: // most recent first
return (a, b) => new Date(b.last_updated).getTime() - new Date(a.last_updated).getTime()
case SortMode.LEAST_MATCHED:
- return compareScratchScores
- case SortMode.MOST_MATCHED:
return (a, b) => compareScratchScores(b, a)
+ case SortMode.MOST_MATCHED:
+ return compareScratchScores
}
}
diff --git a/frontend/src/components/compiler/PresetSelect.tsx b/frontend/src/components/compiler/PresetSelect.tsx
index b0572f6ae..44c1d2f0f 100644
--- a/frontend/src/components/compiler/PresetSelect.tsx
+++ b/frontend/src/components/compiler/PresetSelect.tsx
@@ -24,9 +24,7 @@ export default function PresetSelect({ className, platform, presetId, setPreset,
if (typeof serverPresets === "undefined")
serverPresets = api.usePresets(platform)
- const sortedPresets = typeof serverPresets === "undefined" ? null : serverPresets.slice().sort((a, b) => a.name.localeCompare(b.name))
-
- if (sortedPresets === null) {
+ if (typeof serverPresets === "undefined") {
return
}
- const selectedPreset = sortedPresets.find((p: api.Preset) => p.id === presetId)
+ const selectedPreset = serverPresets.find((p: api.Preset) => p.id === presetId)
- if (sortedPresets.length > 0 && typeof presetId === "number" && !selectedPreset)
+ if (serverPresets.length > 0 && typeof presetId === "number" && !selectedPreset)
console.warn(`Scratch.preset == '${presetId}' but no preset with that id was found.`)
return