|
@ -27,7 +27,7 @@ |
|
|
</span> |
|
|
</span> |
|
|
<input |
|
|
<input |
|
|
type="text" |
|
|
type="text" |
|
|
placeholder="DID, Name, Public Key" |
|
|
placeholder="DID, Name, Public Key (base 16 or 64)" |
|
|
class="block w-full rounded-l border border-r-0 border-slate-400 px-3 py-2" |
|
|
class="block w-full rounded-l border border-r-0 border-slate-400 px-3 py-2" |
|
|
v-model="contactInput" |
|
|
v-model="contactInput" |
|
|
/> |
|
|
/> |
|
@ -265,6 +265,7 @@ import { |
|
|
SimpleSigner, |
|
|
SimpleSigner, |
|
|
} from "@/libs/crypto"; |
|
|
} from "@/libs/crypto"; |
|
|
import { |
|
|
import { |
|
|
|
|
|
CONTACT_URL_PREFIX, |
|
|
GiveServerRecord, |
|
|
GiveServerRecord, |
|
|
GiveVerifiableCredential, |
|
|
GiveVerifiableCredential, |
|
|
RegisterVerifiableCredential, |
|
|
RegisterVerifiableCredential, |
|
@ -479,6 +480,12 @@ export default class ContactsView extends Vue { |
|
|
); |
|
|
); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.contactInput.startsWith(CONTACT_URL_PREFIX)) { |
|
|
|
|
|
await this.newContactFromScan(this.contactInput); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let did = this.contactInput; |
|
|
let did = this.contactInput; |
|
|
let name, publicKeyBase64; |
|
|
let name, publicKeyBase64; |
|
|
const commaPos1 = this.contactInput.indexOf(","); |
|
|
const commaPos1 = this.contactInput.indexOf(","); |
|
@ -497,7 +504,7 @@ export default class ContactsView extends Vue { |
|
|
publicKeyBase64 = Buffer.from(publicKeyBase64, "hex").toString("base64"); |
|
|
publicKeyBase64 = Buffer.from(publicKeyBase64, "hex").toString("base64"); |
|
|
} |
|
|
} |
|
|
const newContact = { did, name, publicKeyBase64 }; |
|
|
const newContact = { did, name, publicKeyBase64 }; |
|
|
return this.addContact(newContact); |
|
|
await this.addContact(newContact); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async newContactFromScan(url: string): Promise<void> { |
|
|
async newContactFromScan(url: string): Promise<void> { |
|
|