Skip to content

Commit

Permalink
fix: callapi.refreshSession() on each download component load
Browse files Browse the repository at this point in the history
  • Loading branch information
ful1e5 committed Nov 21, 2023
1 parent ba69397 commit b2ab623
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/DownloadButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const DownloadButton: React.FC<Props> = (props) => {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${api.jwt?.token}`
Authorization: `Bearer ${props.token}`
},
body: JSON.stringify({
platform,
Expand All @@ -135,7 +135,7 @@ export const DownloadButton: React.FC<Props> = (props) => {

setErrorLogs({ text: '' });

await api.refreshSession(props.token);
// await api.refreshSession(props.token);
const { count, total } = await getDownloadCounts(props.token);
if ((total && count >= total) || (count === 0 && total === 0)) {
setErrorLogs({ text: 'Download Limit Exceeded.' });
Expand Down Expand Up @@ -208,7 +208,7 @@ export const DownloadButton: React.FC<Props> = (props) => {

useEffect(() => {
if (lock === false) {
api.deleteSession();
api.refreshSession(props.token);
}
}, [lock, props.lock, props.disabled, props.token]); // eslint-disable-line react-hooks/exhaustive-deps

Expand Down

0 comments on commit b2ab623

Please sign in to comment.