1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

fixup! chore(core): update core to reflect cache and context refactor [no changelog]

This commit is contained in:
M1nd3r 2024-11-20 10:38:33 +01:00
parent 91d477c3c4
commit efda21a2a7
3 changed files with 9 additions and 8 deletions

View File

@ -329,7 +329,7 @@ class Layout(Generic[T]):
def _paint(self) -> None:
"""Paint the layout and ensure that homescreen cache is properly invalidated."""
import storage.cache_common as storage_cache
import storage.cache as storage_cache
painted = self.layout.paint()
if painted:

View File

@ -1,7 +1,8 @@
from typing import TYPE_CHECKING
import storage.cache_common as storage_cache
import storage.cache as storage_cache
import trezorui2
from storage.cache_common import APP_COMMON_BUSY_DEADLINE_MS
from trezor import TR, ui
if TYPE_CHECKING:
@ -129,6 +130,6 @@ class Busyscreen(HomescreenBase):
# Handle timeout.
result = await super().get_result()
assert result == trezorui2.CANCELLED
context.cache_delete(storage_cache.APP_COMMON_BUSY_DEADLINE_MS)
context.cache_delete(APP_COMMON_BUSY_DEADLINE_MS)
set_homescreen()
return result

View File

@ -1,7 +1,7 @@
import utime
from typing import TYPE_CHECKING
import storage.cache_common as cache_common
import storage.cache as storage_cache
from trezor import log, loop
from trezor.enums import MessageType
@ -153,7 +153,7 @@ def close_others() -> None:
if not task.is_running():
task.close()
cache_common.homescreen_shown = None
storage_cache.homescreen_shown = None
# if tasks were running, closing the last of them will run start_default
@ -211,11 +211,11 @@ class IdleTimer:
time and saves it to storage.cache. This is done to avoid losing an
active timer when workflow restart happens and tasks are lost.
"""
if _restore_from_cache and cache_common.autolock_last_touch is not None:
now = cache_common.autolock_last_touch
if _restore_from_cache and storage_cache.autolock_last_touch is not None:
now = storage_cache.autolock_last_touch
else:
now = utime.ticks_ms()
cache_common.autolock_last_touch = now
storage_cache.autolock_last_touch = now
for callback, task in self.tasks.items():
timeout_us = self.timeouts[callback]