Timothy Jaeryang Baek 5 месяцев назад
Родитель
Сommit
50c3be2136
1 измененных файлов с 3 добавлено и 1 удалено
  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)) {
 		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>