Skip to content

Commit

Permalink
feat(wallet): reenable invitationDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 17, 2021
1 parent 2ff0065 commit 6655857
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions packages/dapp-svelte-wallet/api/src/lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export function makeWallet({
async function updateInboxState(id, offer, doPush = true) {
// Only sent the uncompiled offer to the client.
const { proposalTemplate } = offer;
const { instance, installation } = idToOffer.get(id);
const { instance, installation, invitationDetails } = idToOffer.get(id);
if (!instance || !installation) {
// We haven't yet deciphered the invitation, so don't send
// this offer.
Expand All @@ -375,12 +375,13 @@ export function makeWallet({
const offerForDisplay = {
...offer,
// We cannot store the actions, installation, and instance in the
// displayed offer objects because they are presences are presences and we
// displayed offer objects because they are presences and we
// don't wish to send presences to the frontend.
actions: undefined,
installation: undefined,
instance: undefined,
proposalTemplate,
invitationDetails: display(invitationDetails),
instancePetname: instanceDisplay.petname,
installationPetname: installationDisplay.petname,
proposalForDisplay: displayProposal(alreadyDisplayed || proposalTemplate),
Expand Down Expand Up @@ -583,7 +584,11 @@ export function makeWallet({
// === API

const addIssuer = async (petnameForBrand, issuerP, makePurse = false) => {
const { brand, issuer } = await brandTable.initIssuer(issuerP);
const issuer = await issuerP;
const recP = brandTable.hasByIssuer(issuer)
? brandTable.getByIssuer(issuer)
: brandTable.initIssuer(issuer);
const { brand } = await recP;
if (!issuerToBoardId.has(issuer)) {
const issuerBoardId = await E(board).getId(issuer);
issuerToBoardId.init(issuer, issuerBoardId);
Expand Down Expand Up @@ -814,14 +819,14 @@ export function makeWallet({
offer,
);

const { installation, instance } = await E(zoe).getInvitationDetails(
invitationP,
);
const invitationDetails = await E(zoe).getInvitationDetails(invitationP);
const { installation, instance } = invitationDetails;

return {
proposal,
inviteP: invitationP,
purseKeywordRecord,
invitationDetails,
installation,
instance,
};
Expand Down

0 comments on commit 6655857

Please sign in to comment.