Skip to content

Commit ed0aa1c

Browse files
committed
get ./testme running again with saved data
This commit was sponsored by Jardo, rockstar, Greg Back, and my other patrons. If you want to join them, you can support my work at https://glyph.im/patrons/.
1 parent aee71a9 commit ed0aa1c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/pomodouroboros/model/schema.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Literal, TypedDict, Union
1+
from typing import Literal, NotRequired, TypedDict, Union
22

33
SavedIntervalType = Literal["Pomodoro", "GracePeriod", "Break", "StartPrompt", "Idle"]
44
SavedEstimate = TypedDict(
@@ -113,6 +113,6 @@
113113
# scalability
114114
"previousStreaks": list[SavedStreak],
115115
"sessions": list[SavedSession],
116-
"sessionRules": list[SavedRule],
116+
"sessionRules": NotRequired[list[SavedRule]],
117117
},
118118
)

src/pomodouroboros/model/storage.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ def loadOneTime(savedTime: SavedTime) -> Time[ZoneInfo]:
169169
_interfaceFactory=userInterfaceFactory,
170170
_lastUpdateTime=lastUpdateTime,
171171
_liveInterval=Idle(0, inf),
172-
_sessionRules=[loadRule(rule) for rule in saved["sessionRules"]],
172+
_sessionRules=[
173+
loadRule(rule) for rule in saved.get("sessionRules", [])
174+
],
173175
)
174176
return nexus
175177

0 commit comments

Comments
 (0)