fix catch
This commit is contained in:
parent
ad92607a21
commit
56c0ad3b5f
1 changed files with 4 additions and 3 deletions
|
|
@ -1250,12 +1250,13 @@ export class App implements AfterViewInit, OnInit, OnDestroy {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await navigator.share(payload);
|
await navigator.share(payload);
|
||||||
} catch (err: any) {
|
} catch (err) {
|
||||||
|
const e = err as { name?: string; message?: string };
|
||||||
// AbortError = user dismissed the share sheet → silent no-op.
|
// AbortError = user dismissed the share sheet → silent no-op.
|
||||||
if (err?.name === 'AbortError') return;
|
if (e.name === 'AbortError') return;
|
||||||
console.error('Share failed:', err);
|
console.error('Share failed:', err);
|
||||||
window.alert(
|
window.alert(
|
||||||
`Share failed: ${err?.message || 'unknown error'}. ` +
|
`Share failed: ${e.message || 'unknown error'}. ` +
|
||||||
`Please use the download button instead.`
|
`Please use the download button instead.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue