# Refactor DraftState for improved type safety and consistency

- Replaced manual cache key handling with `DraftCache` class using properties
- Fixed connected_participants serialization by converting sets to lists
- Updated countdown clock component to accept unified state prop
This commit is contained in:
2025-08-23 13:55:04 -05:00
parent e8bf313f53
commit b38c779772
2 changed files with 76 additions and 93 deletions

View File

@@ -269,7 +269,7 @@ class DraftParticipantConsumer(DraftConsumerBase):
"subtype": DraftMessage.PARTICIPANT_JOIN_CONFIRM,
"payload": {
"user": self.user.username,
"connected_participants": self.draft_state.connected_participants,
"connected_participants": list(self.draft_state.connected_participants),
},
},
)
@@ -287,7 +287,7 @@ class DraftParticipantConsumer(DraftConsumerBase):
"subtype": DraftMessage.PARTICIPANT_LEAVE_INFORM,
"payload": {
"user": self.user.username,
"connected_participants": self.draft_state.connected_participants,
"connected_participants": list(self.draft_state.connected_participants),
},
},
)