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 c712b9b commit 19e96bc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 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 All @@ -39,6 +39,10 @@ const useMessageHandler = () => {
return;
}

if (checkTokenExpiration(token)) {
window.dispatchEvent(new CustomEvent('attemptRefresh'));
}

// determine the model to be used
const { endpoint } = currentConversation;
let endpointOption = {};
Expand Down

0 comments on commit 19e96bc

Please sign in to comment.