I would execute following two tasks one after the other:
- download image save to disk
- call a backend method and then navigate to Instagram
<a
data-lightbox-anima="fade-top"
className={`btn`}
download={`${organizationShortId}-${programId}`}
href={`/t44-post-cover/${organizationShortId}-${programId}`}
onClick={(e) => {
dispatch(
createShare({
props: {
tempUserShortId: getTempUserShortId(),
postId,
},
andThen: (_) => {
if (
confirm(
"Megnyitom az Instgramot, s megosztom az utoljára mentett animációt!"
)
) {
router.push(`https://www.instagram.com`);
}
},
})
);
}}
>
Insta
</a>
Unfortunately in mobil only download get started and finished, but confirm dialog will not appear anymore. What can I do to do both task?