Timothy Jaeryang Baek 5 months ago
parent
commit
50c3be2136
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/lib/components/chat/Messages/CitationsModal.svelte

+ 3 - 1
src/lib/components/chat/Messages/CitationsModal.svelte

@@ -38,7 +38,9 @@
 			};
 		});
 		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>