Skip to content

Commit

Permalink
fix: Resolve key parsing issue in contract response handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 23, 2024
1 parent 2f2a877 commit 58ed8db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/components/app/freenet_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ impl FreenetApiSynchronizer {
match response {
HostResponse::ContractResponse(contract_response) => {
match contract_response {
ContractResponse::GetResponse { key, state, .. } => {
ContractResponse::GetResponse { key, state, _ } => {
// Update rooms with received state
if let Ok(room_state) = ciborium::from_reader(state.as_ref()) {
let mut rooms = use_context::<Signal<Rooms>>();
let mut rooms = rooms.write();
if let Some(room_data) = rooms.map.get_mut(&VerifyingKey::from_bytes(key.id().as_ref()).expect("Invalid key bytes")) {
if let Some(room_data) = rooms.map.get_mut(&key.ASDFASDF .expect("Invalid key bytes")) { // The key here needs to come from the parameters associated with the contract, but I'm not sure how to get that, should we add the Room's ContractKey to Rooms or RoomData? AI?
if let Err(e) = room_data.room_state.merge(
&room_data.room_state,
&room_data.parameters(),
Expand Down

0 comments on commit 58ed8db

Please sign in to comment.