Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -8,28 +8,6 @@ import { getSupportedExtension, convertToGLB, ACCEPTED_EXTENSIONS } from '@/lib/
|
|||||||
import { convertIFCtoGLB } from '@/lib/convertIFC';
|
import { convertIFCtoGLB } from '@/lib/convertIFC';
|
||||||
import { CloudLoader } from '@/components/CloudLoader';
|
import { CloudLoader } from '@/components/CloudLoader';
|
||||||
|
|
||||||
/**
|
|
||||||
* Normaliza URLs comuns para apontar ao binário direto.
|
|
||||||
* - Dropbox: força dl=1
|
|
||||||
* - OneDrive (1drv.ms / onedrive.live.com): força download=1
|
|
||||||
*/
|
|
||||||
function normalizeCloudUrl(input: string): string {
|
|
||||||
try {
|
|
||||||
const u = new URL(input);
|
|
||||||
if (/(^|\.)dropbox\.com$/.test(u.hostname)) {
|
|
||||||
u.searchParams.set('dl', '1');
|
|
||||||
return u.toString();
|
|
||||||
}
|
|
||||||
if (/(^|\.)1drv\.ms$|onedrive\.live\.com$/.test(u.hostname)) {
|
|
||||||
u.searchParams.set('download', '1');
|
|
||||||
return u.toString();
|
|
||||||
}
|
|
||||||
return input;
|
|
||||||
} catch {
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const Index = () => {
|
const Index = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const fileInputRef = useRef<HTMLInputElement>(null);
|
const fileInputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user