Skip to content

Commit

Permalink
fix asset calls
Browse files Browse the repository at this point in the history
  • Loading branch information
zippy committed Jan 5, 2025
1 parent 59e2bcc commit 4f6156a
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 65 deletions.
223 changes: 182 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
"tool-devy": "concurrently \"npm start -w ui\" \"sleep 1 && weave --agent-idx 1 --dev-config we_dev/config.ts\" \"sleep 10 && weave --agent-idx 2 --dev-config we_dev/config.ts\"",
"tool-devx": "BPORT=46263 SPORT=46262; concurrently \"hc run-local-services -b $BPORT -s $SPORT\" \"npm start -w ui\" \"./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 1 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\" \"sleep 10 && ./we_dev/we.AppImage --dev-config we_dev/config.json --agent-num 2 -b http://127.0.0.1:$BPORT -s ws://127.0.0.1:$SPORT\"",
"test": "npm run build:zomes && hc app pack workdir --recursive && npm t -w tests",
"package": "npm run build:happ && npm run package -w ui && hc web-app pack workdir --recursive",
"package": "npm run build:happ && npm run package -w ui && hc web-app pack workdir --recursive && npm run weave-hash",
"build:happ": "npm run build:zomes && hc app pack workdir --recursive",
"build:zomes": "RUSTFLAGS='' CARGO_TARGET_DIR=target cargo build --release --target wasm32-unknown-unknown --workspace --exclude kandoapp",
"build:android": "npm run package && npm run tauri android build --apk",
"local-services": "hc run-local-services --bootstrap-interface $INTERNAL_IP --bootstrap-port $BOOTSTRAP_PORT --signal-interfaces $INTERNAL_IP --signal-port $SIGNAL_PORT",
"tauri": "tauri"
"tauri": "tauri",
"weave-hash": "weave hash-webhapp ./workdir/kando.webhapp"
},
"devDependencies": {
"@theweave/cli": "0.13.0-rc.0",
Expand Down
14 changes: 7 additions & 7 deletions ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ui",
"version": "0.12-rc.0",
"version": "0.12-rc.1",
"dnaVersion": "0.12.0",
"scripts": {
"start": "vite --clearScreen false",
Expand All @@ -10,14 +10,14 @@
"package": "rm -f dist.zip && npm run build && cd dist && bestzip ../dist.zip *"
},
"dependencies": {
"@holochain-open-dev/elements": "^0.400.0-rc.0",
"@holochain-open-dev/profiles": "^0.400.0-rc.0",
"@holochain-open-dev/stores": "^0.400.0-rc.0",
"@holochain-open-dev/utils": "^0.400.0-rc.0",
"@holochain-open-dev/elements": "^0.400.0",
"@holochain-open-dev/profiles": "^0.400.0",
"@holochain-open-dev/stores": "^0.400.0",
"@holochain-open-dev/utils": "^0.400.0",
"@holochain-syn/core": "^0.400.0-rc.2",
"@holochain/client": "^0.18.0",
"@theweave/api": "^0.4.0-alpha.0",
"@theweave/elements": "^0.4.0-alpha.0",
"@theweave/api": "^0.4.0-alpha.1",
"@theweave/elements": "^0.4.0-alpha.1",
"@mdi/js": "^7.1.96",
"@msgpack/msgpack": "^3.0.0-beta2",
"@shoelace-style/shoelace": "^2.19",
Expand Down
4 changes: 2 additions & 2 deletions ui/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
throw new Error("Unsupported applet-view type");
}
break;
case "cross-applet-view":
case "cross-group-view":
switch (this.weaveClient.renderInfo.view.type) {
case "main":
// here comes your rendering logic for the cross-applet main view
Expand All @@ -174,7 +174,7 @@
//
//break;
default:
throw new Error("Unknown cross-applet-view render type.");
throw new Error("Unknown cross-group-view render type.");
}
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions ui/src/AttachmentsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
}
const addAttachment = async () => {
const wal = await store.weaveClient.userSelectWal()
const wal = await store.weaveClient.assets.userSelectAsset()
if (wal) {
const srcHrl: WAL = card ? {hrl:[store.dnaHash, activeBoard.hash],context:card.id}: {hrl:[store.dnaHash, activeBoard.hash]}
await store.weaveClient.requestBind(srcHrl, wal)
// const srcHrl: WAL = card ? {hrl:[store.dnaHash, activeBoard.hash],context:card.id}: {hrl:[store.dnaHash, activeBoard.hash]}
// await store.weaveClient.assets.(srcHrl, wal)
_addAttachment(wal)
}
}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/AttachmentsList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class:attachment-item-with-delete={allowDelete}
class:attachment-item={!allowDelete}
>
{#await store.weaveClient.assetInfo(wal)}
{#await store.weaveClient.assets.assetInfo(wal)}
<div style="cursor:pointer; padding: 0 5px 0 5px; border: dashed 1px;margin-right:5px" title={`Resolving WAL: ${hrlToString(wal.hrl)}?${JSON.stringify(wal.context)}`}> ...</div>
{:then data}
{#if data}
Expand All @@ -45,7 +45,7 @@
e.stopPropagation()
try {
// embedLink = index
await store.weaveClient.openWal(wal)
await store.weaveClient.openAsset(wal)
} catch(e) {
alert(`Error opening link: ${e}`)
}
Expand Down
1 change: 1 addition & 0 deletions ui/src/BoardMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
const loadWeaveGroupName = async () => {
if(!store.weaveClient) return;
//@ts-ignore this should only be called in applet-view so there will always be an appletHash
const appletInfo = await store.weaveClient.appletInfo(store.weaveClient.renderInfo.appletHash);
const groupProfile = await store.weaveClient.groupProfile(appletInfo.groupsHashes[0]);
weaveGroupName = groupProfile.name;
Expand Down
Loading

0 comments on commit 4f6156a

Please sign in to comment.