From 8baeabc5c24d82b1b69bb5446328be269bfd8368 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Sat, 21 Dec 2024 14:10:45 -0600 Subject: [PATCH] feat: Fix Dioxus signal and slice conversion issues in freenet_api --- ui/src/components/app/freenet_api.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/components/app/freenet_api.rs b/ui/src/components/app/freenet_api.rs index d6454de..73c1db2 100644 --- a/ui/src/components/app/freenet_api.rs +++ b/ui/src/components/app/freenet_api.rs @@ -1,7 +1,7 @@ use std::collections::HashSet; use futures::StreamExt; use common::room_state::ChatRoomParametersV1; -use dioxus::prelude::{Global, GlobalSignal, UnboundedSender, use_coroutine, use_context, Signal}; +use dioxus::prelude::{Global, GlobalSignal, UnboundedSender, use_coroutine, use_context, Signal, Writable}; use ed25519_dalek::VerifyingKey; use freenet_stdlib::{ client_api::{ClientRequest, ContractRequest, HostResponse, ContractResponse}, @@ -106,7 +106,7 @@ impl FreenetApiSynchronizer { match contract_response { ContractResponse::GetResponse { key, state, .. } => { // Update rooms with received state - if let Ok(room_state) = ciborium::from_reader(state.as_slice()) { + if let Ok(room_state) = ciborium::from_reader(&state.0) { let mut rooms = use_context::>(); let mut rooms = rooms.write(); if let Some(room_data) = rooms.map.get_mut(&key.into()) { @@ -126,7 +126,7 @@ impl FreenetApiSynchronizer { let mut rooms = use_context::>(); let mut rooms = rooms.write(); if let Some(room_data) = rooms.map.get_mut(&key.into()) { - if let Ok(delta) = ciborium::from_reader(update.as_slice()) { + if let Ok(delta) = ciborium::from_reader(&update.0) { if let Err(e) = room_data.room_state.apply_delta( &room_data.room_state, &room_data.parameters(),