Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions surfaces/localhost/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,12 @@ function attachChat(id: string, c: Client, rt: AgentRuntime) {
}
case "ownedSkills": {
try {
const r = await mkt.ownedSkills();
c.send({ type: "ownedSkills", ...r });
const names = mkt.ownedNftSkills ? await mkt.ownedNftSkills() : await mkt.ownedSkills();
const [mints, disposedMints] = await Promise.all([
mkt.ownedSkillMints ? mkt.ownedSkillMints().catch(() => ({})) : Promise.resolve({}),
mkt.disposedSkillMints ? mkt.disposedSkillMints().catch(() => ({})) : Promise.resolve({}),
]);
c.send({ type: "ownedSkills", names, mints, disposedMints });
} catch (e) {
c.send({ type: "toast", text: "Failed to load owned skills: " + (e as Error).message });
}
Expand Down
2 changes: 1 addition & 1 deletion surfaces/webview/src/state/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function reducer(state: State, ev: Action): State {
buyCelebrate: ev.ok ? true : state.buyCelebrate,
};
case "ownedSkills":
return { ...state, marketOwned: ev.names };
return { ...state, marketOwned: Array.isArray(ev.names) ? ev.names : [] };
case "balance":
return { ...state, marketBalance: ev.lamports };
case "rpcStatus":
Expand Down