Skip to content

Commit

Permalink
Merge pull request #103 from Holo-Host/fix-qa-bug-07-17
Browse files Browse the repository at this point in the history
Fix qa bug 07 17
  • Loading branch information
robbiecarlton authored Jul 18, 2024
2 parents 96bdbd8 + 0047926 commit 6f79ff1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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
12 changes: 8 additions & 4 deletions src/utils/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ export async function getBase64EncodedMembraneProof ({
// Get the membrane_proof from the server
let params

const payload = typeof membrane_proof_server_payload === 'string'
? JSON.parse(membrane_proof_server_payload)
: membrane_proof_server_payload

try {
params = {
registration_code,
agent_pub_key: agent_id,
email: email,
payload: JSON.parse(membrane_proof_server_payload)
registration_code,
agent_pub_key: agent_id,
email: email,
payload,
}
} catch {
throw new Error('Membrane Proof payload parsing error')
Expand Down

0 comments on commit 6f79ff1

Please sign in to comment.