This commit is contained in:
Timothy Jaeryang Baek 2024-11-24 18:11:48 -08:00
parent 907cf61da7
commit 50c3be2136

View File

@ -38,7 +38,9 @@
}; };
}); });
if (mergedDocuments.every((doc) => doc.distance !== undefined)) { if (mergedDocuments.every((doc) => doc.distance !== undefined)) {
mergedDocuments.sort((a, b) => (a.distance ?? Infinity) - (b.distance ?? Infinity)); mergedDocuments = mergedDocuments.sort(
(a, b) => (b.distance ?? Infinity) - (a.distance ?? Infinity)
);
} }
} }
</script> </script>