Add success toast after file conversion

This commit is contained in:
thefoxcost 2025-11-28 12:36:34 -08:00
parent a9de9dba70
commit c32d447a07
2 changed files with 10 additions and 1 deletions

View File

@ -112,6 +112,7 @@ export class VertFile {
? await this.convertZip(converter) ? await this.convertZip(converter)
: await converter.convert(this, this.to, ...args); : await converter.convert(this, this.to, ...args);
this.result = res; this.result = res;
this.toastSuccess();
} catch (err) { } catch (err) {
if (!this.cancelled) this.toastErr(err); if (!this.cancelled) this.toastErr(err);
this.result = null; this.result = null;
@ -120,6 +121,14 @@ export class VertFile {
return res; return res;
} }
private toastSuccess() {
ToastManager.add({
type: "success",
message: `${this.file.name} converted to ${this.to.toUpperCase()} and ready to download`,
});
}
private async convertZip(converter: Converter): Promise<VertFile> { private async convertZip(converter: Converter): Promise<VertFile> {
const { extractZip, createZip } = await import("$lib/util/zip"); const { extractZip, createZip } = await import("$lib/util/zip");
const { default: PQueue } = await import("p-queue"); const { default: PQueue } = await import("p-queue");