Changes
Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -7,6 +7,28 @@ import { toast } from 'sonner';
|
|||||||
import { getSupportedExtension, convertToGLB, ACCEPTED_EXTENSIONS } from '@/lib/convertToGLB';
|
import { getSupportedExtension, convertToGLB, ACCEPTED_EXTENSIONS } from '@/lib/convertToGLB';
|
||||||
import { convertIFCtoGLB } from '@/lib/convertIFC';
|
import { convertIFCtoGLB } from '@/lib/convertIFC';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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