Remove feature check
This commit is contained in:
parent
80be02d6a4
commit
a7c7b42de2
@ -39,7 +39,6 @@ export function meta() {
|
||||
export default function () {
|
||||
const [fileProgress, setFileProgress] = useState(0);
|
||||
const [showSuccess, setShowSuccess] = useState(false);
|
||||
const [supportsRequestStreams, setSupportsRequestStreams] = useState(false);
|
||||
const toast = useToast();
|
||||
const [uploading, setUploading] = useState(false);
|
||||
const [loading, setLoading] = useState(false);
|
||||
@ -53,26 +52,6 @@ export default function () {
|
||||
wmv: "video/x-ms-wmv",
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setSupportsRequestStreams(
|
||||
(() => {
|
||||
let duplexAccessed = false;
|
||||
|
||||
const hasContentType = new Request("", {
|
||||
body: new ReadableStream(),
|
||||
method: "POST",
|
||||
// @ts-ignore
|
||||
get duplex() {
|
||||
duplexAccessed = true;
|
||||
return "half";
|
||||
},
|
||||
}).headers.has("Content-Type");
|
||||
|
||||
return duplexAccessed && !hasContentType;
|
||||
})(),
|
||||
);
|
||||
}, []);
|
||||
|
||||
const { logged_in, site_key } = useLoaderData<typeof loader>();
|
||||
|
||||
async function submit() {
|
||||
@ -213,6 +192,8 @@ export default function () {
|
||||
xhr.send(files[i]);
|
||||
}
|
||||
|
||||
setUploading(false);
|
||||
|
||||
if (shouldRecall) {
|
||||
setLoading(false);
|
||||
await fetch("/api/reports/recall", {
|
||||
@ -328,13 +309,10 @@ export default function () {
|
||||
Submit
|
||||
</Button>
|
||||
<CircularProgress
|
||||
display={uploading ? "" : "none"}
|
||||
isIndeterminate={!supportsRequestStreams}
|
||||
value={supportsRequestStreams ? fileProgress : undefined}
|
||||
display={uploading ? undefined : "none"}
|
||||
value={fileProgress}
|
||||
>
|
||||
{supportsRequestStreams ? (
|
||||
<CircularProgressLabel>{fileProgress}%</CircularProgressLabel>
|
||||
) : null}
|
||||
<CircularProgressLabel>{fileProgress}%</CircularProgressLabel>
|
||||
</CircularProgress>
|
||||
</HStack>
|
||||
</Container>
|
||||
|
Loading…
x
Reference in New Issue
Block a user