Skip to content

Commit

Permalink
update clone cell sample code to reflect the fact that clones are ena…
Browse files Browse the repository at this point in the history
…bled at birth
  • Loading branch information
pdaoust committed Dec 19, 2024
1 parent 4458a61 commit 99a00ac
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/pages/resources/upgrade/upgrade-holochain-0.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,16 @@ Edit any client code that manipulates cloned cells by cell ID to use DNA hash in
import { AppWebsocket, CellId } from "@holochain/client";
let client: AppClient = await AppWebsocket.connect();
let role_name = "chat";
async function createChatRoom(name: string) {
const { cell_id } = await client.createCloneCell({
modifiers: { network_seed: name },
name,
role_name
});
await client.enableCloneCell({
async function archiveChatRoom(cell_id: CellId) {
await client.disableCloneCell({
- clone_cell_id: cell_id,
+ clone_cell_id: cell_id[0],
});
return cell_id;
}
async function removeChatRoom(cell_id: CellId) {
await client.disableCloneCell({
async function reopenChatRoom(cell_id: CellId) {
await client.enableCloneCell({
- clone_cell_id: cell_id,
+ clone_cell_id: cell_id[0],
});
Expand Down

0 comments on commit 99a00ac

Please sign in to comment.