2
0
mirror of https://github.com/ComradCollective/Comrad synced 2024-11-19 15:25:34 +00:00
Comrad/comrad/app/screens/refresh/refresh.py
marxzuckerburg 5fc627379f fixes
2020-10-02 15:33:44 +01:00

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())