From 7bc8b8391d123ec0fd1c519bae0e1c4bd1b7415f Mon Sep 17 00:00:00 2001 From: shekhar-cis Date: Wed, 15 Jun 2022 16:57:46 +0530 Subject: [PATCH] update payment screen state varialble --- src/bitmessagekivy/baseclass/payment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bitmessagekivy/baseclass/payment.py b/src/bitmessagekivy/baseclass/payment.py index 5b27d39e..7fcf9b58 100644 --- a/src/bitmessagekivy/baseclass/payment.py +++ b/src/bitmessagekivy/baseclass/payment.py @@ -5,6 +5,8 @@ from kivy.uix.boxlayout import BoxLayout from kivy.uix.screenmanager import Screen from kivy.app import App +from bitmessagekivy.baseclass.common import kivy_state_variables + from kivymd.uix.behaviors.elevation import RectangularElevationBehavior from kivymd.uix.label import MDLabel from kivymd.uix.list import ( @@ -24,15 +26,14 @@ class Payment(Screen): def __init__(self, *args, **kwargs): super(Payment, self).__init__(*args, **kwargs) - self.kivy_running_app = App.get_running_app() - self.kivy_state = self.kivy_running_app.kivy_state_obj + self.kivy_state = kivy_state_variables() def get_free_credits(self, instance): """Get the available credits""" # pylint: disable=no-self-use self.kivy_state.availabe_credit = instance.parent.children[1].text - # existing_credits = state.kivyapp.root.ids.sc18.ids.cred.text - existing_credits = self.kivy_running_app.root.ids.sc18.ids.cred.text + # existing_credits = state.kivyapp.root.ids.sc18.ids.cred.texpt + existing_credits = App.get_running_app().root.ids.sc18.ids.cred.text if float(existing_credits.split()[1]) > 0: toast( 'We already have added free Credit'