update connect payload and adjust minor template/js

seed-restores
lza_menace 4 years ago
parent 0167ce098c
commit 85ce2c2fb5

@ -99,6 +99,13 @@ def dashboard():
@wallet_bp.route('/wallet/connect') @wallet_bp.route('/wallet/connect')
@login_required @login_required
def connect(): def connect():
if current_user.wallet_created is False:
data = {
'result': 'fail',
'message': 'Wallet not yet created'
}
return jsonify(data)
if current_user.wallet_connected is False: if current_user.wallet_connected is False:
wallet = docker.start_wallet(current_user.id) wallet = docker.start_wallet(current_user.id)
port = docker.get_port(wallet) port = docker.get_port(wallet)
@ -107,8 +114,17 @@ def connect():
current_user.wallet_container = wallet current_user.wallet_container = wallet
current_user.wallet_start = datetime.utcnow() current_user.wallet_start = datetime.utcnow()
db.session.commit() db.session.commit()
data = {
'result': 'success',
'message': 'Wallet has been connected'
}
else:
data = {
'result': 'fail',
'message': 'Wallet is already connected'
}
return 'ok' return jsonify(data)
@wallet_bp.route('/wallet/create') @wallet_bp.route('/wallet/create')
@login_required @login_required

@ -29,7 +29,7 @@ function check_status(){
// Check every few seconds... // Check every few seconds...
window.setInterval(function(){ window.setInterval(function(){
check_status(); check_status();
}, 6000); }, 10000);
// ...but also check on initial page load // ...but also check on initial page load
check_status(); check_status();

@ -10,7 +10,7 @@
<section class="section2"> <section class="section2">
<div class="container"> <div class="container">
<div class="section-heading text-center"> <div class="section-heading text-center">
<h2>Pick An Option</h2> <h2>Setup Wallet</h2>
<p>Alrighty there hoss, pick an option below...</p> <p>Alrighty there hoss, pick an option below...</p>
<hr><br /><br /> <hr><br /><br />

Loading…
Cancel
Save