Skip to content

Clarify the idle gating logic and the wasIdleBefore flag #65

Description

@Attacktive

https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L43-L57 (state variables at https://github.com/Attacktive/nyan-wanderer/blob/25c8379a4fb8974d015f130ede60ea73b6f7158e/package/contents/ui/main.qml#L22-L25)

The wasIdleBefore flag does not really track "was idle before" — it is set true on the first move and only reset by idleTimer, so it effectively means "this is not the first move, and we did not just finish idling." Inside the idle branch it is also re-assigned wasIdleBefore = true even though the guard already requires it to be true (a dead assignment).

The behavior is probably intended (do not idle on the very first move; do not idle twice in a row), but the naming and the redundant write make it hard to follow.

Suggested fix: rename to something like hasMovedOnce / canIdle, drop the redundant assignment, and add a short comment on the intent.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions