mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
Change download to happen in the renderer (#365)
This commit is contained in:
@@ -97,10 +97,13 @@ export class ElectronPlatformUtilsService implements PlatformUtilsService {
|
||||
}
|
||||
|
||||
saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {
|
||||
ipcRenderer.invoke('saveFile', {
|
||||
fileName: fileName,
|
||||
buffer: Buffer.from(blobData),
|
||||
});
|
||||
const blob = new Blob([blobData], blobOptions);
|
||||
const a = win.document.createElement('a');
|
||||
a.href = URL.createObjectURL(blob);
|
||||
a.download = fileName;
|
||||
win.document.body.appendChild(a);
|
||||
a.click();
|
||||
win.document.body.removeChild(a);
|
||||
}
|
||||
|
||||
getApplicationVersion(): Promise<string> {
|
||||
|
||||
Reference in New Issue
Block a user