Skip to content

Commit

Permalink
fix: stop passing undefined reject in legacy file-save setup handler (
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle authored Apr 28, 2022
1 parent 222023f commit 3f19b5e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export interface FirstFileSaveOptions extends FirstCoreFileOptions {
* https://github.com/whatwg/html/issues/6376 is specified and supported.
*/
legacySetup?: (
resolve: (value: Blob) => void,
resolve: () => void,
rejectionHandler: () => void,
anchor: HTMLAnchorElement
) => (reject?: (reason?: any) => void) => void;
) => () => void;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/legacy/file-save.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default async (blobOrPromiseBlobOrResponse, options = {}) => {
a.download = options.fileName || 'Untitled';
a.href = URL.createObjectURL(await data);

const _reject = () => cleanupListenersAndMaybeReject(reject);
const _reject = () => cleanupListenersAndMaybeReject();
const _resolve = () => {
if (typeof cleanupListenersAndMaybeReject === 'function') {
cleanupListenersAndMaybeReject();
Expand Down

0 comments on commit 3f19b5e

Please sign in to comment.