From 160da353062676ffaa2823a92cc570e7f3be9dfe Mon Sep 17 00:00:00 2001 From: Eric Harris-Braun Date: Wed, 7 Aug 2024 11:25:37 -0400 Subject: [PATCH] fix AnyAgent bug --- ui/src/emergence-client.ts | 9 +++++---- ui/src/emergence/emergence/AnyAvatar.svelte | 6 ++++-- ui/src/emergence/emergence/ProxyAgentDetail.svelte | 4 ++-- ui/src/emergence/emergence/types.ts | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ui/src/emergence-client.ts b/ui/src/emergence-client.ts index 66ecbae..c398c31 100644 --- a/ui/src/emergence-client.ts +++ b/ui/src/emergence-client.ts @@ -18,6 +18,7 @@ export function fixAnyAgent(a:AnyAgent) { return {type:x, hash:a.hash} } export function unfixAnyAgent(a:any): AnyAgent { + console.log("FISHIN ANY AGENT", a) const type = Object.keys(a.type)[0] //@ts-ignore const x:AnyAgent = {type, hash:a.hash} @@ -114,15 +115,15 @@ export class EmergenceClient { trashed: false }; - // @ts-ignore - sessionEntry.leaders = sessionEntry.leaders.map(l=>fixAnyAgent(l)) + // // @ts-ignore + // sessionEntry.leaders = sessionEntry.leaders.map(l=>fixAnyAgent(l)) console.log("NEW SES", sessionEntry) return new EntryRecord(await this.callZome('create_session', sessionEntry)) } async updateSession(update: UpdateSessionInput) : Promise> { - // @ts-ignore - update.updated_leaders = update.updated_leaders.map(l=>fixAnyAgent(l)) + // // @ts-ignore + // update.updated_leaders = update.updated_leaders.map(l=>fixAnyAgent(l)) return new EntryRecord(await this.callZome('update_session', update)) } diff --git a/ui/src/emergence/emergence/AnyAvatar.svelte b/ui/src/emergence/emergence/AnyAvatar.svelte index 8389895..f521044 100644 --- a/ui/src/emergence/emergence/AnyAvatar.svelte +++ b/ui/src/emergence/emergence/AnyAvatar.svelte @@ -19,7 +19,7 @@ {#if agent.type=="Agent"} -{:else} +{:else if agent.type=="ProxyAgent"}
{ store.openDetails(DetailsType.ProxyAgent, agent.hash) @@ -30,13 +30,15 @@ {#if proxyAgent} {:else} - No Agent! + (?) {/if} {/if} {#if showNickname}
{proxyAgent ? proxyAgent.record.entry.nickname : "unknown"}
{/if}
+{:else} + (?) {/if}