Skip to content

Commit

Permalink
Update handleSubmit.js
Browse files Browse the repository at this point in the history
  • Loading branch information
bsu3338 authored Jul 28, 2023
1 parent b2f0324 commit 4816e59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/src/utils/handleSubmit.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const useMessageHandler = () => {
const timeLeft = tokenPayload.exp - currentTime;
return timeLeft < 30;
};
if (checkTokenExpiration(token)) {
window.dispatchEvent(new CustomEvent('attemptRefresh'));
}
// if (checkTokenExpiration(token)) {
// window.dispatchEvent(new CustomEvent('attemptRefresh'));
// }

const { getToken } = store.useToken(currentConversation?.endpoint);

Expand Down Expand Up @@ -211,6 +211,9 @@ const useMessageHandler = () => {
} else {
setMessages([...currentMessages, currentMsg, initialResponse]);
}
if (checkTokenExpiration(token)) {
window.dispatchEvent(new CustomEvent('attemptRefresh'));
}
setSubmission(submission);
};

Expand Down

0 comments on commit 4816e59

Please sign in to comment.