Move the account list to the App view

This commit is contained in:
Rodolphe Bréard 2023-07-30 14:04:06 +02:00
parent 564d2e26d4
commit 9734c64097
2 changed files with 22 additions and 18 deletions

View file

@ -1,7 +1,25 @@
<script setup>
import { ref } from 'vue';
import MainView from "./views/MainView.vue";
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]),
},
];
</script>
<template>
<MainView />
<MainView :accounts="accounts" />
</template>

View file

@ -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);