fix timers
lint / ruff (push) Failing after 15s
tests / desktop (push) Successful in 21s
tests / web (push) Successful in 46s
docker / image (push) Failing after 1m31s
tests / android-core (push) Successful in 1m5s
tests / backend (push) Successful in 2m33s
android / apk (push) Successful in 4m34s

This commit is contained in:
timka123 committed 2026-10-27 18:52:54 +03:00
1 parent ff77d8f89f
commit 157a113c39
30 files changed
+3331 -419

No files matched your search

+12 -2
View File
@@ -87,8 +87,18 @@ class Api:
def resume(self) -> dict:
return self._request("POST", "/api/timer/resume", {})
def complete(self, auto_next: bool = True) -> dict:
return self._request("POST", "/api/timer/complete", {"auto_next": auto_next})
def complete(self, auto_next: bool = True, session_id: int | None = None) -> dict:
"""`session_id` names the interval we think we are finishing.
The server ignores the call if something else is running by then, which
is what keeps two clients hitting zero at the same moment from eating
the break the first one's `auto_next` just started.
"""
return self._request(
"POST",
"/api/timer/complete",
{"auto_next": auto_next, "session_id": session_id},
)
def abandon(self, reason: str | None = None) -> dict:
return self._request("POST", "/api/timer/abandon", {"reason": reason})