Fixed button race

This commit is contained in:
Mark Qvist 2023-10-24 01:28:49 +02:00
parent 8fee0bae58
commit 338f608382
2 changed files with 18 additions and 4 deletions

View File

@ -674,7 +674,13 @@ class SidebandCore():
return ""
def peer_appearance(self, context_dest):
return self._db_get_appearance(context_dest) or SidebandCore.DEFAULT_APPEARANCE
appearance = self._db_get_appearance(context_dest)
if appearance == None:
return SidebandCore.DEFAULT_APPEARANCE
for e in appearance:
if e == None:
return SidebandCore.DEFAULT_APPEARANCE
return appearance
def peer_display_name(self, context_dest):
if context_dest == self.lxmf_destination.hash:

View File

@ -8,6 +8,7 @@ from kivymd.uix.recycleview import MDRecycleView
from kivymd.uix.list import OneLineIconListItem
from kivy.properties import StringProperty, BooleanProperty
from kivy.effects.scroll import ScrollEffect
from kivy.clock import Clock
from sideband.sense import Telemeter
import threading
import webbrowser
@ -72,11 +73,18 @@ class ObjectDetails():
rendered_telemetry = telemeter.render()
if "location" in telemeter.sensors:
def job(dt):
self.screen.ids.coordinates_button.disabled = False
Clock.schedule_once(job, 0.01)
self.telemetry_list.update_source(rendered_telemetry)
def job(dt):
self.screen.ids.telemetry_button.disabled = False
Clock.schedule_once(job, 0.01)
else:
def job(dt):
self.screen.ids.telemetry_button.disabled = True
Clock.schedule_once(job, 0.01)
self.telemetry_list.update_source(None)
def reload(self):