Timothy Jaeryang Baek hace 4 meses
padre
commit
de4e086bd5
Se han modificado 1 ficheros con 12 adiciones y 3 borrados
  1. 12 3
      src/lib/components/chat/Messages/RateComment.svelte

+ 12 - 3
src/lib/components/chat/Messages/RateComment.svelte

@@ -52,12 +52,21 @@
 	}
 
 	const init = () => {
-		selectedReason = message?.annotation?.reason ?? '';
-		comment = message?.annotation?.comment ?? '';
+		if (!selectedReason) {
+			selectedReason = message?.annotation?.reason ?? '';
+		}
+
+		if (!comment) {
+			comment = message?.annotation?.comment ?? '';
+		}
+
 		tags = (message?.annotation?.tags ?? []).map((tag) => ({
 			name: tag
 		}));
-		detailedRating = message?.annotation?.details?.rating ?? null;
+
+		if (!detailedRating) {
+			detailedRating = message?.annotation?.details?.rating ?? null;
+		}
 	};
 
 	onMount(() => {