GmailTrust commited on
Commit
37b4edb
·
verified ·
1 Parent(s): 5967427

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -195,13 +195,21 @@ SERVICES = [
195
  "GGPLAY", "INSTAGRAM", "FMCPAY", "AMAZON"
196
  ]
197
 
198
- notification_message = ""
 
 
 
 
 
 
199
 
200
  def update_notification(msg_input, password):
201
- global notification_message
202
  if password == "2312":
203
- notification_message = msg_input
204
- return notification_message
 
 
 
205
 
206
  with gr.Blocks() as demo:
207
  gr.Markdown("## ZGM API Client - Enter Key to Rent OTP")
 
195
  "GGPLAY", "INSTAGRAM", "FMCPAY", "AMAZON"
196
  ]
197
 
198
+ NOTIFICATION_FILE = "notification.txt"
199
+
200
+ def read_notification() -> str:
201
+ if os.path.exists(NOTIFICATION_FILE):
202
+ with open(NOTIFICATION_FILE, "r", encoding="utf-8") as f:
203
+ return f.read()
204
+ return ""
205
 
206
  def update_notification(msg_input, password):
 
207
  if password == "2312":
208
+ with open(NOTIFICATION_FILE, "w", encoding="utf-8") as f:
209
+ f.write(msg_input)
210
+ return msg_input
211
+ return read_notification()
212
+
213
 
214
  with gr.Blocks() as demo:
215
  gr.Markdown("## ZGM API Client - Enter Key to Rent OTP")