first tauri build with new systems

deleted old/unused code
This commit is contained in:
Felix Kaspar
2024-05-18 00:09:46 +02:00
parent a484a804ad
commit 3eca56f8c6
13 changed files with 17 additions and 138 deletions

View File

@@ -7,7 +7,7 @@ export async function getPages(file: PdfFile, pageIndexes: number[]): Promise<Pd
const subDocument = await PDFDocument.create();
// Check that array max number is not larger pdf pages number
if(Math.max(...pageIndexes) >= pdfLibDocument.getPageCount()) {
if(Math.max(...pageIndexes) > pdfLibDocument.getPageCount()) {
throw new Error(`The PDF document only has ${pdfLibDocument.getPageCount()} pages and you tried to extract page ${Math.max(...pageIndexes)}`);
}

View File

@@ -35,7 +35,8 @@ export class Operator {
}
async run(input: PdfFile[] | any[], progressCallback: (progress: Progress) => void): Promise<PdfFile[] | any[]> {
return [];
progressCallback({ curFileProgress: 1, operationProgress: 1 })
return input;
}
}

View File

@@ -7,7 +7,7 @@ export async function getOperatorByName(name: string): Promise<typeof Operator |
// Check if exists
if(!compileTimeOperatorList.includes(name)) return;
i18next.loadNamespaces(name, (err, t) => { if (err) throw err; });
i18next.loadNamespaces(name, (err, t) => { if (err) throw err; console.log(t) });
const loadedModule = await import("../functions/" + name + ".ts");
const operator = loadedModule[capitalizeFirstLetter(name)];
if(!operator) {