Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
address: action.address,
isOpen: true,
},
};
}
case LOGOUT: {
Lockr.rm("account_key");
Lockr.rm("account_address");
Lockr.set("islogin", 0);
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return {
...state,
account: {
key: undefined,
isLoggedIn: false,
},
wallet: {
type: undefined,
address: undefined,
isOpen: false,
},
}
tronStationSDK: new TronStationSDK(action.tronWeb, true)
},
wallet: {
type: ACCOUNT_LEDGER,
address: action.address,
isOpen: true,
},
};
}
case LOGOUT: {
Lockr.rm("account_key");
Lockr.rm("account_address");
Lockr.set("islogin", 0);
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return {
...state,
account: {
key: undefined,
isLoggedIn: false,
},
wallet: {
type: undefined,
}
case LOGOUT: {
Lockr.rm("account_key");
Lockr.rm("account_address");
Lockr.set("islogin", 0);
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return {
...state,
account: {
key: undefined,
isLoggedIn: false,
},
wallet: {
type: undefined,
address: undefined,
isOpen: false,
},
}
}
case SET_THEME: {
//Lockr.set("theme", action.theme);
wallet: {
type: ACCOUNT_LEDGER,
address: action.address,
isOpen: true,
},
};
}
case LOGOUT: {
Lockr.rm("account_key");
Lockr.rm("account_address");
Lockr.set("islogin", 0);
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return {
...state,
account: {
key: undefined,
isLoggedIn: false,
},
wallet: {
type: undefined,
address: undefined,
isOpen: false,
address: action.address,
tronWeb:action.tronWeb,
sunWeb:action.sunWeb,
tronStationSDK: new TronStationSDK(action.tronWeb, true)
},
wallet: {
type: ACCOUNT_LEDGER,
address: action.address,
isOpen: true,
},
};
}
case LOGOUT: {
Lockr.rm("account_key");
Lockr.rm("account_address");
Lockr.set("islogin", 0);
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return {
...state,
account: {
key: undefined,
isLoggedIn: false,
get (key) {
key = this.getOption('prefix') + key
if (!window.localStorage) { // SRP violation, but its ok for this case
// TODO add logging;
return undefined
}
const info = store.get(key)
if (info instanceof Object) {
if (info.val !== undefined && info.exp && info.time) {
if ((Date.now() - info.time) > info.exp) {
store.rm(key)
return undefined
}
return info.val
}
}
return info
}
key: false,
isLoggedIn: true,
address: action.address
},
wallet: {
type: ACCOUNT_ADDRESS,
address: action.address,
isOpen: true,
},
};
}
case LOGIN_TRONLINK:{
if (IS_DESKTOP) {
Lockr.rm("account_key");
// Lockr.set("account_address", action.address);
}
return {
...state,
account: {
key: false,
isLoggedIn: true,
address: action.address,
tronWeb:action.tronWeb,
sunWeb:action.sunWeb,
tronStationSDK: IS_MAINNET? new TronStationSDK(action.tronWeb,true): new TronStationSDK(action.sunWeb.sidechain,true),
},
wallet: {
type: ACCOUNT_TRONLINK,
address: action.address,
isOpen: true,
componentDidMount() {
let { match } = this.props;
if (match.params && match.params.type === 'verify'){
this.setState({
filter: { direction: 'verify' }
});
} else {
// 初始化数据
if (!this.isLoggedIn(1)){
// compileCode
Lockr.rm('CompileCode');
// compile status
Lockr.rm('CompileStatus');
// contractNameList
Lockr.rm('contractNameList');
// compileInfo
Lockr.rm('compileInfo');
// compile files
Lockr.rm('compileFiles');
return;
}
this.initCompile();
}
}
remove (key) {
key = this.getOption('prefix') + key
return store.rm(key)
}