From d7454a073b86766654fd97355be747cf34fb0e3c Mon Sep 17 00:00:00 2001 From: wukko Date: Wed, 11 Sep 2024 14:42:54 +0600 Subject: [PATCH] web/download: assume userActivation expired if agent doesn't support it --- web/src/lib/download.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/src/lib/download.ts b/web/src/lib/download.ts index b0c80d31..78e465de 100644 --- a/web/src/lib/download.ts +++ b/web/src/lib/download.ts @@ -77,8 +77,10 @@ export const downloadFile = ({ url, file }: { url?: string, file?: File }) => { navigator.userActivation.isActive makes sure that we're still able to invoke an action without the user agent interrupting it. if not, we show a saving dialog for user to re-invoke that action. + + if browser is old or doesn't support this API, we just assume that it expired. */ - if (!navigator.userActivation.isActive) { + if (!navigator?.userActivation?.isActive) { return openSavingDialog({ url, file,