You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
633 B
Python
23 lines
633 B
Python
from screens.base import ProtectedScreen
|
|
from screens.map import MapWidget
|
|
import asyncio
|
|
|
|
|
|
class RefreshScreen(ProtectedScreen):
|
|
|
|
def on_pre_enter(self):
|
|
if not super().on_pre_enter(): return
|
|
|
|
async def go():
|
|
self.log(f'REFRESH: {self.app.is_logged_in}, {self.app.comrad.name}')
|
|
if not hasattr(self.app,'map') or not self.app.map:
|
|
self.app.map=MapWidget()
|
|
self.app.map.open()
|
|
await self.app.comrad.get_updates()
|
|
self.app.map.dismiss()
|
|
self.app.map=None
|
|
self.app.go_back()
|
|
|
|
asyncio.create_task(go())
|
|
|