Skip to content

Commit

Permalink
testing incogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Austin committed Apr 20, 2019
1 parent 7ab0726 commit 77a0b0d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ let dollarDisplay = (amount)=>{

let interval
let intervalLong
let originalStyle = {}

class App extends Component {
constructor(props) {
Expand Down Expand Up @@ -346,14 +347,16 @@ 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"
var elem = document.createElement('div');
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');
Expand Down
15 changes: 6 additions & 9 deletions src/services/incogDetect.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -106,8 +105,6 @@ module.exports = function(callback) {
}
}



retry(
function isDone() {
return typeof is_private !== 'undefined' ? true : false;
Expand Down

0 comments on commit 77a0b0d

Please sign in to comment.