Prevent sending empty feedback

technically can still send just a bunch of spaces, but whatever
This commit is contained in:
Lance Edgar 2023-09-25 22:43:01 -05:00
parent a7ab1b5882
commit 0767b81d0b

View file

@ -410,6 +410,9 @@ class POSView(WuttaView):
autofocus=True) autofocus=True)
def send_feedback(e): def send_feedback(e):
if message.value:
self.app.send_email('pos_feedback', data={ self.app.send_email('pos_feedback', data={
'user_name': self.page.session.get('user_display'), 'user_name': self.page.session.get('user_display'),
'message': message.value, 'message': message.value,
@ -425,6 +428,10 @@ class POSView(WuttaView):
self.page.snack_bar.open = True self.page.snack_bar.open = True
self.main_input.focus() self.main_input.focus()
else:
message.focus()
self.page.update() self.page.update()
def cancel(e): def cancel(e):