From 0a80774066916eff424a72933d2348a7ffb6f697 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Mon, 13 Nov 2017 16:26:26 +0000 Subject: [PATCH] unstatusify redirects --- src/vector/index.js | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index 0577ac82a0..b85e90f632 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -251,20 +251,28 @@ async function loadApp() { if (!preventRedirect) { if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { - window.location = "https://status.im/join-riot.html"; - return; - /*if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) { - window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067"; + if (UserSettingsStore.getTheme() === 'status') { + window.location = "https://status.im/join-riot.html"; return; - }*/ + } + else { + if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) { + window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067"; + return; + } + } } else if (/Android/.test(navigator.userAgent)) { - window.location = "https://status.im/join-riot.html"; - return; - /*if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) { - window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha"; + if (UserSettingsStore.getTheme() === 'status') { + window.location = "https://status.im/join-riot.html"; return; - }*/ + } + else { + if (confirm(_t("Riot is not supported on mobile web. Install the app?"))) { + window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha"; + return; + } + } } }