Use react state to keep track of file names
All checks were successful
Test, Build, Deploy / Test, Build, and Deploy (push) Successful in 1m2s
Test, Build, Deploy / Create Sentry Release (push) Successful in 6s

This commit is contained in:
2026-04-14 02:07:15 -04:00
parent 16ecab6881
commit cb0be09c0d
2 changed files with 21 additions and 17 deletions

View File

@@ -46,6 +46,7 @@ export function meta() {
export default function () { export default function () {
const [fileProgress, setFileProgress] = useState(0); const [fileProgress, setFileProgress] = useState(0);
const [submissionType, setSubmissionType] = useState("exploit"); const [submissionType, setSubmissionType] = useState("exploit");
const [fileNames, setFileNames] = useState([] as string[]);
const [showSuccess, setShowSuccess] = useState(false); const [showSuccess, setShowSuccess] = useState(false);
const toast = useToast(); const toast = useToast();
const [uploading, setUploading] = useState(false); const [uploading, setUploading] = useState(false);
@@ -311,7 +312,26 @@ export default function () {
> >
Select File Select File
</Button> </Button>
<input id="evidence" multiple type="file" /> <input
id="evidence"
multiple
onChange={(e) => {
const names = [];
for (let i = 0; i < (e.target.files?.length || 0); i++) {
const file = e.target.files?.item(i);
if (file) names.push(file.name);
}
setFileNames(names);
}}
style={{ display: "none" }}
type="file"
/>
<Text>
{fileNames.length ? fileNames.join(", ") : "No files chosen"}
</Text>
</FormControl> </FormControl>
<br /> <br />
<FormControl> <FormControl>

View File

@@ -70,22 +70,6 @@ button:focus-visible {
padding: 2em; padding: 2em;
} }
::file-selector-button {
display: none;
}
/* Same thing as above but for Safari */
@media not all and (min-resolution: 0.001dpcm) {
@supports (-webkit-appearance: none) {
text-indent: -120px;
margin-left: -7em;
&::file-selector-button {
display: inline;
}
}
}
.desktop-nav { .desktop-nav {
visibility: visible; visibility: visible;
} }