Skip to content

Commit

Permalink
handle pubkey in agentState
Browse files Browse the repository at this point in the history
  • Loading branch information
robbiecarlton committed Jul 17, 2024
1 parent 809b5bb commit 2fc349a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/stores/useClientStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const makeUseClientStore = ({ useInterfaceStore, onInit, fetchKycLevel }) => def
// onInit is a hack, see stores/index.js for details
onInit?.()

// TODO: this subscribe is getting hacky. investigate a neater way of doing this
useInterfaceStore().$subscribe((_, state) => {
// This could be more efficient by inspecting the contents of mutation
this.isReady = state.isReady
Expand All @@ -32,6 +33,11 @@ const makeUseClientStore = ({ useInterfaceStore, onInit, fetchKycLevel }) => def
if (state.appInfo?.agent_pub_key) {
this.agentKey = state.appInfo.agent_pub_key
}

// we override here the above here because in the holo case, agentState is in general much more up to date than appInfo
if (state.agentState?.pubkey) {
this.agentKey = state.agentState.pubkey
}
})

await useInterfaceStore().initialize()
Expand Down
2 changes: 0 additions & 2 deletions src/utils/registration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export async function getBase64EncodedMembraneProof ({
throw new Error('Membrane Proof payload parsing error')
}



console.log(`^&* about to fetch registration`, membrane_proof_server_url)
console.log(`^&* params`, params)
console.log(`^&* JSON.stringify(params)`, JSON.stringify(params))
Expand Down

0 comments on commit 2fc349a

Please sign in to comment.