Skip to content

Commit

Permalink
Merge pull request #24 from ahmadfarhan1981/farhan/cleanup
Browse files Browse the repository at this point in the history
chore: cleanup prepare for release
  • Loading branch information
ahmadfarhan1981 authored Dec 30, 2024
2 parents d0e1165 + 325c846 commit 429609c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion linkstash-frontend/src/app/import/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export default function FileUploadForm() {
const formData = new FormData();
formData.append("file", file);

const defaultTimeout = "5000"; // Default value in milliseconds
const timeoutEnv = process.env.IMPORT_TIMEOUT?process.env.IMPORT_TIMEOUT:defaultTimeout;
let parsedTimeout:number = parseInt(timeoutEnv, 10);
if (isNaN(parsedTimeout)) {
parsedTimeout = parseInt(defaultTimeout)
}



const apiOptions: ApiCallOptions = {
endpoint: "/import",
method: "POST",
Expand All @@ -53,7 +62,7 @@ export default function FileUploadForm() {
Authorization: "Bearer ".concat(AuthenticationState.token),
"content-type": "multipart/form-data",
},
timeout: process.env.IMPORT_TIMEOUT,
timeout: parsedTimeout,
successCallback: (_response: any) => {
setUploadStatus({
type: "success",
Expand Down

0 comments on commit 429609c

Please sign in to comment.