Skip to content

Commit

Permalink
better UX
Browse files Browse the repository at this point in the history
  • Loading branch information
noam_wsl committed Dec 5, 2024
1 parent 4936a96 commit 662be65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/components/gpt_page/main_content/MainContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ const MainContent = () => {

// Function for CreatorChat submission
const onCreatorChatSubmit = useCallback(
(query) => {
async (query) => {
let fullUrl = `${window.location.origin}${window.location.pathname}?query=${encodeURIComponent(query)}`;
generateShortUrl(fullUrl); // Call without awaiting
await generateShortUrl(fullUrl);
setLlmQuery(query);
setIsCreatorChatSubmitted(true);
// Do not start countdown; set static response
Expand All @@ -120,10 +120,10 @@ const MainContent = () => {

// Updated handleSendMessage function
const handleSendMessage = useCallback(
(message) => {
async (message) => {
console.log(`MainContent: User sent message: ${message}`);
let fullUrl = `${window.location.origin}${window.location.pathname}?query=${encodeURIComponent(message)}`;
generateShortUrl(fullUrl); // Call without awaiting
await generateShortUrl(fullUrl);
setLlmQuery(message);
setLlmResponse('');
setIsAnimationChatDoneAnimating(true);
Expand Down

0 comments on commit 662be65

Please sign in to comment.