mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-09-16 14:36:35 +00:00
fix: worker use only i18n keys instead of full i18n
This commit is contained in:
@@ -20,6 +20,7 @@ type WorkerResponse =
|
||||
height?: number;
|
||||
data?: Uint8ClampedArray;
|
||||
text?: string;
|
||||
textVars?: Record<string, string | number>;
|
||||
files?: WorkerImageFile[];
|
||||
}
|
||||
| {
|
||||
@@ -67,6 +68,15 @@ async function handle(request: WorkerRequest): Promise<void> {
|
||||
} satisfies WorkerResponse);
|
||||
return;
|
||||
}
|
||||
if ("key" in output) {
|
||||
(self as unknown as Worker).postMessage({
|
||||
id: request.id,
|
||||
ok: true,
|
||||
text: output.key,
|
||||
textVars: output.vars,
|
||||
} satisfies WorkerResponse);
|
||||
return;
|
||||
}
|
||||
if ("files" in output) {
|
||||
const files = output.files.map((file) => ({
|
||||
name: file.name,
|
||||
|
||||
Reference in New Issue
Block a user