|
@ -17,10 +17,6 @@ |
|
|
:dotsOptions="{ type: 'square' }" |
|
|
:dotsOptions="{ type: 'square' }" |
|
|
class="flex justify-center" |
|
|
class="flex justify-center" |
|
|
/> |
|
|
/> |
|
|
<AlertMessage |
|
|
|
|
|
:alertTitle="alertTitle" |
|
|
|
|
|
:alertMessage="alertMessage" |
|
|
|
|
|
></AlertMessage> |
|
|
|
|
|
</section> |
|
|
</section> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -32,18 +28,15 @@ import { MASTER_SETTINGS_KEY } from "@/db/tables/settings"; |
|
|
import * as R from "ramda"; |
|
|
import * as R from "ramda"; |
|
|
import { SimpleSigner } from "@/libs/crypto"; |
|
|
import { SimpleSigner } from "@/libs/crypto"; |
|
|
import * as didJwt from "did-jwt"; |
|
|
import * as didJwt from "did-jwt"; |
|
|
import AlertMessage from "@/components/AlertMessage"; |
|
|
|
|
|
import QuickNav from "@/components/QuickNav"; |
|
|
import QuickNav from "@/components/QuickNav"; |
|
|
|
|
|
import { Account } from "@/db/tables/accounts"; |
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires |
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires |
|
|
const Buffer = require("buffer/").Buffer; |
|
|
const Buffer = require("buffer/").Buffer; |
|
|
alertTitle = ""; |
|
|
|
|
|
alertMessage = ""; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
@Component({ |
|
|
components: { |
|
|
components: { |
|
|
QRCodeVue3, |
|
|
QRCodeVue3, |
|
|
AlertMessage, |
|
|
|
|
|
QuickNav, |
|
|
QuickNav, |
|
|
}, |
|
|
}, |
|
|
}) |
|
|
}) |
|
@ -55,7 +48,10 @@ export default class ContactQRScanShow extends Vue { |
|
|
public async getIdentity(activeDid) { |
|
|
public async getIdentity(activeDid) { |
|
|
await accountsDB.open(); |
|
|
await accountsDB.open(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const accounts = await accountsDB.accounts.toArray(); |
|
|
const account = R.find((acc) => acc.did === activeDid, accounts); |
|
|
const account: Account | undefined = R.find( |
|
|
|
|
|
(acc) => acc.did === activeDid, |
|
|
|
|
|
accounts, |
|
|
|
|
|
); |
|
|
const identity = JSON.parse(account?.identity || "null"); |
|
|
const identity = JSON.parse(account?.identity || "null"); |
|
|
|
|
|
|
|
|
if (!identity) { |
|
|
if (!identity) { |
|
@ -66,15 +62,6 @@ export default class ContactQRScanShow extends Vue { |
|
|
return identity; |
|
|
return identity; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public async getHeaders(identity) { |
|
|
|
|
|
const token = await accessToken(identity); |
|
|
|
|
|
const headers = { |
|
|
|
|
|
"Content-Type": "application/json", |
|
|
|
|
|
Authorization: "Bearer " + token, |
|
|
|
|
|
}; |
|
|
|
|
|
return headers; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async created() { |
|
|
async created() { |
|
|
await db.open(); |
|
|
await db.open(); |
|
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY); |
|
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY); |
|
|