From d2cea34242900f46eb51039eabfe98b9b1d7da11 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Thu, 29 Dec 2022 16:13:51 -0700 Subject: [PATCH] fix: remove code for lowercase checks (that were for old uPort) --- README.md | 8 +++++++- src/views/AccountViewView.vue | 27 +-------------------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ca6bf7e..1fefb06 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,13 @@ npm run lint ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). + + +## Other + ``` +// reference material from https://github.com/trentlarson/endorser-mobile/blob/8dc8e0353e0cc80ffa7ed89ded15c8b0da92726b/src/utility/idUtility.ts#L83 + // Import an existing ID export const importAndStoreIdentifier = async (mnemonic: string, mnemonicPassword: string, toLowercase: boolean, previousIdentifiers: Array) => { @@ -122,4 +128,4 @@ export const createAndStoreIdentifier = async (mnemonicPassword) => { return importAndStoreIdentifier(mnemonic, mnemonicPassword, false, []) } -``` \ No newline at end of file +``` diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index f40cee4..73c8738 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -175,8 +175,6 @@ import { Options, Vue } from "vue-class-component"; import { useClipboard } from "@vueuse/core"; import { createIdentifier, deriveAddress, newIdentifier } from "../libs/crypto"; -import { IIdentifier } from "@veramo/core"; -import * as R from "ramda"; import { db } from "../db"; import { useAppStore } from "@/store/app"; import { ref } from "vue"; @@ -193,10 +191,8 @@ export default class AccountViewView extends Vue { source = ref("Hello"); copy = useClipboard().copy; + // 'created' hook runs when the Vue instance is first created async created() { - const previousIdentifiers: Array = []; - const toLowercase = true; - const appCondition = useAppStore().condition; if (appCondition == "uninitialized") { this.mnemonic = createIdentifier(); @@ -207,27 +203,6 @@ export default class AccountViewView extends Vue { this.UPORT_ROOT_DERIVATION_PATH, ] = deriveAddress(this.mnemonic); - const prevIds = previousIdentifiers || []; - if (toLowercase) { - const foundEqual = - R.find( - (id: IIdentifier) => id.did.split(":")[2] === this.address, - prevIds - ) || false; - if (foundEqual === false) { - this.address = this.address.toLowerCase(); - } - } else { - const foundLower = R.find( - (id: IIdentifier) => - id.did.split(":")[2] === this.address.toLowerCase(), - prevIds - ); - if (foundLower) { - this.address = this.address.toLowerCase(); - } - } - const newId = newIdentifier( this.address, this.publicHex,