Skip to content

Commit

Permalink
fix uploadPageBlobSasUrl error
Browse files Browse the repository at this point in the history
  • Loading branch information
777arc committed Apr 29, 2024
1 parent e93628d commit fbf193f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions client/src/pages/upload-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export const UploadPage = () => {

// Check if sas token is expired
useEffect(() => {
const expireDateTime = config.data.uploadPageBlobSasUrl.split('&se=')[1].split('&')[0];
if (Date.parse(expireDateTime) - Date.parse(new Date()) < 0) setExpired(true);
}, []);
if (config.data.uploadPageBlobSasUrl) {
const expireDateTime = config.data.uploadPageBlobSasUrl.split('&se=')[1].split('&')[0];
if (Date.parse(expireDateTime) - Date.parse(new Date()) < 0) setExpired(true);
}
}, [config.data.uploadPageBlobSasUrl]);

async function uploadBlob(f) {
// Create azure blob client
Expand Down

0 comments on commit fbf193f

Please sign in to comment.