forked from jsnbuchanan/crowd-funder-for-time-pwa
Merge fixes
This commit is contained in:
@@ -101,14 +101,14 @@ import { NotificationIface } from "../constants/app";
|
||||
import { db, retrieveSettingsForActiveAccount } from "../db/index";
|
||||
import { Contact } from "../db/tables/contacts";
|
||||
import { MASTER_SETTINGS_KEY } from "../db/tables/settings";
|
||||
import { getContactPayloadFromJwtUrl } from "../libs/crypto";
|
||||
import { getContactJwtFromJwtUrl } from "../libs/crypto";
|
||||
import {
|
||||
generateEndorserJwtForAccount,
|
||||
generateEndorserJwtUrlForAccount,
|
||||
isDid,
|
||||
register,
|
||||
setVisibilityUtil,
|
||||
} from "../libs/endorserServer";
|
||||
import { ETHR_DID_PREFIX } from "../libs/crypto/vc";
|
||||
import { decodeEndorserJwt, ETHR_DID_PREFIX } from "../libs/crypto/vc";
|
||||
import { retrieveAccountMetadata } from "../libs/util";
|
||||
|
||||
@Component({
|
||||
@@ -146,7 +146,7 @@ export default class ContactQRScanShow extends Vue {
|
||||
(settings.firstName || "") +
|
||||
(settings.lastName ? ` ${settings.lastName}` : ""); // lastName is deprecated, pre v 0.1.3
|
||||
|
||||
this.qrValue = await generateEndorserJwtForAccount(
|
||||
this.qrValue = await generateEndorserJwtUrlForAccount(
|
||||
account,
|
||||
!!settings.isRegistered,
|
||||
name,
|
||||
@@ -179,8 +179,8 @@ export default class ContactQRScanShow extends Vue {
|
||||
if (url) {
|
||||
let newContact: Contact;
|
||||
try {
|
||||
const payload = getContactPayloadFromJwtUrl(url);
|
||||
if (!payload) {
|
||||
const jwt = getContactJwtFromJwtUrl(url);
|
||||
if (!jwt) {
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
@@ -192,8 +192,9 @@ export default class ContactQRScanShow extends Vue {
|
||||
);
|
||||
return;
|
||||
}
|
||||
const { payload } = decodeEndorserJwt(jwt);
|
||||
newContact = {
|
||||
did: payload.iss as string,
|
||||
did: payload.own.did || payload.iss, // ".own.did" is reliable as of v 0.3.49
|
||||
name: payload.own.name,
|
||||
nextPubKeyHashB64: payload.own.nextPublicEncKeyHash,
|
||||
profileImageUrl: payload.own.profileImageUrl,
|
||||
@@ -405,7 +406,7 @@ export default class ContactQRScanShow extends Vue {
|
||||
useClipboard()
|
||||
.copy(this.qrValue)
|
||||
.then(() => {
|
||||
console.log("Contact URL:", this.qrValue);
|
||||
// console.log("Contact URL:", this.qrValue);
|
||||
this.$notify(
|
||||
{
|
||||
group: "alert",
|
||||
|
||||
Reference in New Issue
Block a user