diff --git a/src/App.js b/src/App.js index b60c2ec45..495964d23 100644 --- a/src/App.js +++ b/src/App.js @@ -235,6 +235,7 @@ let dollarDisplay = (amount)=>{ let interval let intervalLong +let originalStyle = {} class App extends Component { constructor(props) { @@ -346,6 +347,7 @@ class App extends Component { elem.innerHTML = 'INCOGNITO'; document.body.appendChild(elem); }else if (typeof web3 !== 'undefined') { + console.log("NOT INCOG",this.state.metaAccount) if (window.web3.currentProvider.isMetaMask === true) { document.getElementById("main").style.backgroundImage = "linear-gradient(#553319, #ca6e28)" document.body.style.backgroundColor = "#ca6e28" @@ -353,7 +355,8 @@ class App extends Component { elem.style.cssText = 'position:absolute;right:5px;top:-15px;opacity:0.2;z-index:100;font-size:60px;color:#FFFFFF'; elem.innerHTML = 'METAMASK'; document.body.appendChild(elem); - } else if(!this.state.metaAccount) { + } else if(this.state.account && !this.state.metaAccount) { + console.log("~~~*** WEB3",this.state.metaAccount,result) document.getElementById("main").style.backgroundImage = "linear-gradient(#234063, #305582)" document.body.style.backgroundColor = "#305582" var elem = document.createElement('div'); diff --git a/src/services/incogDetect.js b/src/services/incogDetect.js index b9cb16ff7..882ea5bc1 100644 --- a/src/services/incogDetect.js +++ b/src/services/incogDetect.js @@ -1,5 +1,5 @@ - //snagged from https://stackoverflow.com/questions/52759238/private-incognito-mode-detection-for-ios-12-safari +//snagged from https://stackoverflow.com/questions/52759238/private-incognito-mode-detection-for-ios-12-safari function retry(isDone, next) { var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; @@ -87,12 +87,11 @@ module.exports = function(callback) { if (window.safariIncognito) { is_private = true; } else { - try { - window.openDatabase(null, null, null, null); - } catch (e) { - is_private = true; - } - + try { + window.openDatabase(null, null, null, null); + } catch (e) { + is_private = true; + } try { window.localStorage.setItem('test', 1); } catch(e) { @@ -106,8 +105,6 @@ module.exports = function(callback) { } } - - retry( function isDone() { return typeof is_private !== 'undefined' ? true : false;