Small Bugfixes (#2414)
This commit is contained in:
parent
26b0cb7d0c
commit
b7e7eaf1a4
22 changed files with 91 additions and 87 deletions
|
@ -14,7 +14,6 @@ import {
|
|||
of,
|
||||
filter,
|
||||
} from 'rxjs';
|
||||
import { SAVER, Saver } from '../_providers/saver.provider';
|
||||
import { download, Download } from '../_models/download';
|
||||
import { PageBookmark } from 'src/app/_models/readers/page-bookmark';
|
||||
import {switchMap, take, takeWhile, throttleTime} from 'rxjs/operators';
|
||||
|
@ -69,7 +68,7 @@ export class DownloadService {
|
|||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(private httpClient: HttpClient, private confirmService: ConfirmService,
|
||||
@Inject(SAVER) private save: Saver, private accountService: AccountService) { }
|
||||
private accountService: AccountService) { }
|
||||
|
||||
|
||||
/**
|
||||
|
@ -270,4 +269,15 @@ export class DownloadService {
|
|||
finalize(() => this.finalizeDownloadState(downloadType, subtitle))
|
||||
);
|
||||
}
|
||||
|
||||
private save(blob: Blob, filename: string) {
|
||||
const saveLink = document.createElement( 'a' );
|
||||
if (saveLink.href) {
|
||||
URL.revokeObjectURL(saveLink.href);
|
||||
}
|
||||
saveLink.href = URL.createObjectURL(blob);
|
||||
saveLink.download = filename;
|
||||
saveLink.dispatchEvent( new MouseEvent( 'click' ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue