@ -42,7 +42,6 @@ def setup():
@login_required
@login_required
def loading ( ) :
def loading ( ) :
if current_user . wallet_connected and current_user . wallet_created :
if current_user . wallet_connected and current_user . wallet_created :
sleep ( 1 )
return redirect ( url_for ( ' wallet.dashboard ' ) )
return redirect ( url_for ( ' wallet.dashboard ' ) )
if current_user . wallet_created is False :
if current_user . wallet_created is False :
return redirect ( url_for ( ' wallet.setup ' ) )
return redirect ( url_for ( ' wallet.setup ' ) )
@ -63,10 +62,12 @@ def dashboard():
password = current_user . wallet_password
password = current_user . wallet_password
)
)
if not docker . container_exists ( current_user . wallet_container ) :
if not docker . container_exists ( current_user . wallet_container ) :
print ( ' container does not exist. ' )
current_user . clear_wallet_data ( )
current_user . clear_wallet_data ( )
return redirect ( url_for ( ' wallet.loading ' ) )
return redirect ( url_for ( ' wallet.loading ' ) )
if not wallet . connected :
if not wallet . connected :
print ( ' container not connected ' )
return redirect ( url_for ( ' wallet.loading ' ) )
return redirect ( url_for ( ' wallet.loading ' ) )
address = wallet . get_address ( )
address = wallet . get_address ( )
@ -127,18 +128,13 @@ def create():
def status ( ) :
def status ( ) :
user_vol = docker . get_user_volume ( current_user . id )
user_vol = docker . get_user_volume ( current_user . id )
restore_container = cache . get_data ( f ' restoring_ { current_user . id } ' )
restore_container = cache . get_data ( f ' restoring_ { current_user . id } ' )
if restore_container :
restoring = True
else :
restoring = False
data = {
data = {
' created ' : current_user . wallet_created ,
' created ' : current_user . wallet_created ,
' connected ' : current_user . wallet_connected ,
' connected ' : current_user . wallet_connected ,
' port ' : current_user . wallet_port ,
' port ' : current_user . wallet_port ,
' container ' : current_user . wallet_container ,
' container ' : current_user . wallet_container ,
' volume ' : docker . volume_exists ( user_vol ) ,
' volume ' : docker . volume_exists ( user_vol ) ,
' restoring ' : restoring ,
' restoring ' : docker . container_exists ( restore_container )
' restore_container ' : restore_container
}
}
return jsonify ( data )
return jsonify ( data )