Skip to content

Commit

Permalink
feat: Fix import and type conversion issues in UI code
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 23, 2024
1 parent 671cbba commit 8637335
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/src/components/app/freenet_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ 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>>();
Expand Down
7 changes: 6 additions & 1 deletion ui/src/example_data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
use crate::room_data::{RoomData, Rooms};
use crate::{
room_data::{RoomData, Rooms},
util::to_cbor_vec,
constants::ROOM_CONTRACT_WASM,
};
use freenet_stdlib::prelude::{ContractCode, ContractInstanceId, ContractKey, Parameters};
use crate::util::random_full_name;
use common::room_state::ChatRoomParametersV1;
use common::{
Expand Down
2 changes: 1 addition & 1 deletion ui/src/room_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl Rooms {
};
let params_bytes = to_cbor_vec(&parameters);
let contract_code = ContractCode::from(ROOM_CONTRACT_WASM);
let instance_id = ContractInstanceId::from_params_and_code(params_bytes.into(), contract_code);
let instance_id = ContractInstanceId::from_params_and_code(Parameters::from(params_bytes), contract_code);
let contract_key = ContractKey::from(instance_id);

let room_data = RoomData {
Expand Down

0 comments on commit 8637335

Please sign in to comment.