Skip to content

Commit

Permalink
update to holochain beta 0.1 and new profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Mar 15, 2023
1 parent 6a2b0e6 commit 35a922c
Show file tree
Hide file tree
Showing 28 changed files with 2,717 additions and 653 deletions.
493 changes: 354 additions & 139 deletions Cargo.lock

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ members = [
]

[workspace.dependencies]
hdi = "0.2.0-beta-rc.1"
hdk = "0.1.0-beta-rc.1"
hdi = "=0.2.1"
hdk = "=0.1.1"
holochain = "0.1.3"
serde = "1"

[workspace.dependencies.profiles]
path = "libs/zomes/profiles"

[workspace.dependencies.profiles_integrity]
path = "libs/zomes/profiles_integrity"


[profile.dev]
opt-level = "z"
Expand Down
6 changes: 3 additions & 3 deletions apps/launcher/dnas/how/dna.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ integrity:
zomes:
- name: how_core
bundled: ../../../../target/wasm32-unknown-unknown/release/how_core.wasm
- name: profiles_core
bundled: ../../../../target/wasm32-unknown-unknown/release/profiles_core.wasm
- name: profiles_integrity
bundled: ../../../../target/wasm32-unknown-unknown/release/profiles_integrity.wasm
coordinator:
zomes:
- name: how
Expand All @@ -19,4 +19,4 @@ coordinator:
- name: profiles
bundled: ../../../../target/wasm32-unknown-unknown/release/profiles.wasm
dependencies:
- name: profiles_core
- name: profiles_integrity
6 changes: 3 additions & 3 deletions apps/launcher/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@holochain-open-dev/profiles": "^0.9.3",
"@holochain/client": "^0.11.9",
"@lit-labs/context": "^0.1.2",
"@holochain-open-dev/profiles": "^0.11.2",
"@holochain/client": "^0.12.5",
"@lit-labs/context": "^0.2.0",
"@how/elements": "^0.0.1",
"lit": "^2.1.4"
}
Expand Down
37 changes: 22 additions & 15 deletions apps/launcher/ui/src/how-app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ContextProvider } from "@lit-labs/context";
import { state } from "lit/decorators.js";
import { property, state } from "lit/decorators.js";
import {
HowController,
HowUnit,
Expand All @@ -10,37 +10,44 @@ import {
ProfilePrompt,
ProfilesStore,
profilesStoreContext,
ProfilesService,
ProfilesClient,
ProfilesConfig,
} from "@holochain-open-dev/profiles";
import { AppAgentWebsocket, AppWebsocket } from '@holochain/client';
import { ScopedElementsMixin } from "@open-wc/scoped-elements";
import { LitElement, html } from "lit";
import { provide } from '@lit-labs/context';

export class HowApp extends ScopedElementsMixin(LitElement) {
@state()
loaded = false;

async firstUpdated() {
const appWebsocket = await AppWebsocket.connect('');
@provide({ context: howContext })
@property()
_howStore!: HowStore;

const client = await AppAgentWebsocket.connect(appWebsocket, "how")
@provide({ context: profilesStoreContext })
@property()
_profilesStore!: ProfilesStore;

async firstUpdated() {

const store = new ProfilesStore(new ProfilesService(client, 'how'), {
avatarMode: "avatar-required",
})
const appAgentClient = await AppAgentWebsocket.connect("", "how")


store.fetchAllProfiles()

new ContextProvider(this, profilesStoreContext, store);
this._howStore = new HowStore(appAgentClient, "how")

new ContextProvider(
this,
howContext,
new HowStore(client, store, "how")
const config:ProfilesConfig = {
minNicknameLength: 3,
avatarMode: "avatar-optional",
additionalFields: [], // "Location","Hashtags", "Bio"// Custom app level profile fields
};

this._profilesStore = new ProfilesStore(
new ProfilesClient(appAgentClient, 'how'), config
);


this.loaded = true;
}

Expand Down
14 changes: 0 additions & 14 deletions default.nix

This file was deleted.

Loading

0 comments on commit 35a922c

Please sign in to comment.