From 9734c64097e18227b36591f7be2b17b3e5c18360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 30 Jul 2023 14:04:06 +0200 Subject: [PATCH] Move the account list to the App view --- src/App.vue | 20 +++++++++++++++++++- src/views/MainView.vue | 20 +++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/App.vue b/src/App.vue index 2b0c606..600d717 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,25 @@ diff --git a/src/views/MainView.vue b/src/views/MainView.vue index 72ab975..7680fe4 100644 --- a/src/views/MainView.vue +++ b/src/views/MainView.vue @@ -4,24 +4,10 @@ import { hmac } from '@noble/hashes/hmac'; import { sha256 } from '@noble/hashes/sha256'; import base32Encode from 'base32-encode' -const accounts = [ - { - id: 'bbca792e-0cf4-414f-8d6e-eea3df8e20b3', - localPart: 'a', - separator: '+', - domain: 'example.org', - key: Uint8Array.from([215, 91, 232, 137, 231, 202, 228, 248, 2, 95, 145, 117, 77, 55, 46, 161]), - }, - { - id: '6ff7bae6-6c6c-43d7-a75c-859e6ecbdbd8', - localPart: 'b', - separator: '+', - domain: 'example.org', - key: Uint8Array.from([215, 91, 232, 137, 231, 202, 228, 248, 2, 95, 145, 117, 77, 55, 46, 161]), - }, -]; -const selectedAccountId = ref('6ff7bae6-6c6c-43d7-a75c-859e6ecbdbd8'); +const { accounts } = defineProps(['accounts']); +const selectedAccountId = ref(accounts[0].id); const subAddrName = ref(''); + const generatedAddr = computed(() => { if (selectedAccountId.value && subAddrName.value) { const account = accounts.find((e) => e.id == selectedAccountId.value);