mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Format web app code with prettier recommendations
Too many of these had accumulated earlier from being ignored. Changed to make build logs less noisy
This commit is contained in:
@@ -817,38 +817,44 @@ const ChatMessage = forwardRef<HTMLDivElement, ChatMessageProps>((props, ref) =>
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
{props.chatMessage.by === "khoj" && props.onRetryMessage && props.isLastMessage && (
|
||||
<button
|
||||
title="Retry"
|
||||
className={`${styles.retryButton}`}
|
||||
onClick={() => {
|
||||
const turnId = props.chatMessage.turnId || props.turnId;
|
||||
const query = props.chatMessage.rawQuery || props.chatMessage.intent?.query;
|
||||
console.log("Retry button clicked for turnId:", turnId);
|
||||
console.log("ChatMessage data:", {
|
||||
rawQuery: props.chatMessage.rawQuery,
|
||||
intent: props.chatMessage.intent,
|
||||
message: props.chatMessage.message
|
||||
});
|
||||
console.log("Extracted query:", query);
|
||||
if (query) {
|
||||
props.onRetryMessage?.(query, turnId);
|
||||
} else {
|
||||
console.error("No original query found for retry");
|
||||
// Fallback: try to get from a previous user message or show an input dialog
|
||||
const fallbackQuery = prompt("Enter the original query to retry:");
|
||||
if (fallbackQuery) {
|
||||
props.onRetryMessage?.(fallbackQuery, turnId);
|
||||
{props.chatMessage.by === "khoj" &&
|
||||
props.onRetryMessage &&
|
||||
props.isLastMessage && (
|
||||
<button
|
||||
title="Retry"
|
||||
className={`${styles.retryButton}`}
|
||||
onClick={() => {
|
||||
const turnId = props.chatMessage.turnId || props.turnId;
|
||||
const query =
|
||||
props.chatMessage.rawQuery ||
|
||||
props.chatMessage.intent?.query;
|
||||
console.log("Retry button clicked for turnId:", turnId);
|
||||
console.log("ChatMessage data:", {
|
||||
rawQuery: props.chatMessage.rawQuery,
|
||||
intent: props.chatMessage.intent,
|
||||
message: props.chatMessage.message,
|
||||
});
|
||||
console.log("Extracted query:", query);
|
||||
if (query) {
|
||||
props.onRetryMessage?.(query, turnId);
|
||||
} else {
|
||||
console.error("No original query found for retry");
|
||||
// Fallback: try to get from a previous user message or show an input dialog
|
||||
const fallbackQuery = prompt(
|
||||
"Enter the original query to retry:",
|
||||
);
|
||||
if (fallbackQuery) {
|
||||
props.onRetryMessage?.(fallbackQuery, turnId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ArrowClockwise
|
||||
alt="Retry Message"
|
||||
className="hsl(var(--muted-foreground)) hover:text-blue-500"
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
}}
|
||||
>
|
||||
<ArrowClockwise
|
||||
alt="Retry Message"
|
||||
className="hsl(var(--muted-foreground)) hover:text-blue-500"
|
||||
/>
|
||||
</button>
|
||||
)}
|
||||
<button
|
||||
title="Copy"
|
||||
className={`${styles.copyButton}`}
|
||||
|
||||
Reference in New Issue
Block a user