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