fix(export): enable proper file downloads and fix empty PNG export
This commit is contained in:
@@ -8,6 +8,15 @@ export class AsciiExporter {
|
||||
link.click();
|
||||
}
|
||||
|
||||
static downloadText(content: string, filename: string) {
|
||||
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
|
||||
const link = document.createElement('a');
|
||||
link.href = URL.createObjectURL(blob);
|
||||
link.download = filename;
|
||||
link.click();
|
||||
URL.revokeObjectURL(link.href);
|
||||
}
|
||||
|
||||
static async copyToClipboard(text: string): Promise<void> {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
await navigator.clipboard.writeText(text);
|
||||
|
||||
Reference in New Issue
Block a user