From 85ce2c2fb550feee8a3183a19ca5f327ef6ae24c Mon Sep 17 00:00:00 2001 From: lza_menace Date: Tue, 29 Dec 2020 14:46:05 -0800 Subject: [PATCH] update connect payload and adjust minor template/js --- wowstash/blueprints/wallet/routes.py | 18 +++++++++++++++++- wowstash/templates/scripts.html | 2 +- wowstash/templates/wallet/setup.html | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/wowstash/blueprints/wallet/routes.py b/wowstash/blueprints/wallet/routes.py index 617c8ab..2e0fc43 100644 --- a/wowstash/blueprints/wallet/routes.py +++ b/wowstash/blueprints/wallet/routes.py @@ -99,6 +99,13 @@ def dashboard(): @wallet_bp.route('/wallet/connect') @login_required 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: wallet = docker.start_wallet(current_user.id) port = docker.get_port(wallet) @@ -107,8 +114,17 @@ def connect(): current_user.wallet_container = wallet current_user.wallet_start = datetime.utcnow() 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') @login_required diff --git a/wowstash/templates/scripts.html b/wowstash/templates/scripts.html index 4710ed6..66ab7e1 100644 --- a/wowstash/templates/scripts.html +++ b/wowstash/templates/scripts.html @@ -29,7 +29,7 @@ function check_status(){ // Check every few seconds... window.setInterval(function(){ check_status(); -}, 6000); +}, 10000); // ...but also check on initial page load check_status(); diff --git a/wowstash/templates/wallet/setup.html b/wowstash/templates/wallet/setup.html index b3aa812..ca20475 100644 --- a/wowstash/templates/wallet/setup.html +++ b/wowstash/templates/wallet/setup.html @@ -10,7 +10,7 @@
-

Pick An Option

+

Setup Wallet

Alrighty there hoss, pick an option below...