lod export
This commit is contained in:
14
app/page.tsx
14
app/page.tsx
@@ -8,8 +8,6 @@ export default function XgridsWizard() {
|
||||
const workerRef = useRef<Worker | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
// 1. Point to the NEW location in the /app folder
|
||||
// Next.js recognizes the 'new URL' pattern and bundles it as a separate worker
|
||||
const worker = new Worker(
|
||||
new URL("./workers/converter.worker.ts", import.meta.url),
|
||||
);
|
||||
@@ -18,11 +16,17 @@ export default function XgridsWizard() {
|
||||
worker.onmessage = (e) => {
|
||||
const { type, message, data } = e.data;
|
||||
if (type === "LOG") setStatus(message);
|
||||
|
||||
if (type === "DONE") {
|
||||
setIsProcessing(false);
|
||||
setStatus("Conversion Complete!");
|
||||
downloadFile(data.sog, `${data.fileName}.sog`);
|
||||
// Removed: downloadFile(data.ply, ...) — worker doesn't produce a PLY
|
||||
setStatus(
|
||||
`Conversion Complete! Downloading ${data.files.length} files...`,
|
||||
);
|
||||
|
||||
// Loop through all generated files and trigger downloads
|
||||
data.files.forEach((file: { name: string; blob: Blob }) => {
|
||||
downloadFile(file.blob, file.name);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user