Combined fixes (#116)

* fix: missing CheckIcon import in LanguageSelector

* fix: #114 and error handling

* fix: #97

* fix: lint

* feat: #104

* fix: #72
This commit is contained in:
DecDuck
2025-06-10 10:08:01 +10:00
committed by GitHub
parent 60abc03091
commit 1bfdd73e4c
10 changed files with 53 additions and 47 deletions

View File

@@ -39,7 +39,7 @@ export class ObjectTransactionalHandler {
if (!transaction) return;
let progress = 0;
const increment = (1 / transaction.size) * 100;
const increment = 100 / transaction.size;
for (const [id, data] of transaction) {
if (typeof data === "string") {

View File

@@ -374,8 +374,15 @@ export function wrapTaskContext(
): TaskRunContext {
return {
progress(progress) {
const scalar = 100 / (options.max - options.min);
const adjustedProgress = progress * scalar + options.min;
if (progress > 100 || progress < 0) {
console.warn("[wrapTaskContext] progress must be between 0 and 100");
}
// I was too tired to figure this out
// https://stackoverflow.com/a/929107
const oldRange = 100;
const newRange = options.max - options.min;
const adjustedProgress = (progress * newRange) / oldRange + options.min;
return context.progress(adjustedProgress);
},
log(message) {