diff --git a/public/assets/view.js b/public/assets/view.js index 334bb91..89d6046 100644 --- a/public/assets/view.js +++ b/public/assets/view.js @@ -82,7 +82,12 @@ } $('vClose').addEventListener('click', () => { window.close(); - setMsg('You can close this tab now.'); + // window.close() is blocked in mobile and in-app (wallet dApp) browsers. If + // the tab is still here a moment later, take them back to the dashboard so + // they are never stuck on a tab they can't close. + setTimeout(() => { + if (!window.closed) { setMsg('Taking you back to your dashboard…'); location.href = '/my#earn'; } + }, 400); }); (async () => { const info = await j('/api/my/viewinfo?token=' + token); diff --git a/public/view.html b/public/view.html index 8eba7ea..f1daa14 100644 --- a/public/view.html +++ b/public/view.html @@ -38,12 +38,12 @@ Loading the ad… - - Back to dashboard + Back to dashboard + - +