Skip to content

Commit 324fe33

Browse files
committed
Process any query params - AI will figure it out!
1 parent 617a937 commit 324fe33

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

frontend/src/pages/chat/Chat.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,10 @@ const Chat = () => {
757757
if (!isInitialSearchMessagePosted.current && !appStateContext?.state.isLoading) {
758758
isInitialSearchMessagePosted.current = true;
759759
const queryParams = new URLSearchParams(location.search);
760-
if (queryParams.get('Article') != null && queryParams.get('Feedback') != null) {
761-
const message = "Article: " + queryParams.get('Article') + "\nFeedback: " + queryParams.get('Feedback');
760+
const entries = Array.from(queryParams.entries());
761+
762+
if (entries.length >= 2) {
763+
const message = entries.map(([key, value]) => `${key}: ${value}`).join('\n');
762764
const id = appStateContext?.state.currentChat?.id ? appStateContext?.state.currentChat?.id : undefined;
763765
sendMessage(message, id);
764766
}

0 commit comments

Comments
 (0)