fix add accounts

This commit is contained in:
liangping 2023-05-22 18:53:15 +08:00
parent 8878f28e67
commit 3d2dee9303
2 changed files with 5 additions and 6 deletions

View File

@ -236,7 +236,7 @@ async function addAddress(acc: AccountEntry) {
<div class="modal-box">
<h3 class="font-bold text-lg">Import Accounts
<div class="dropdown dropdown-hover">
<label tabindex="0" class="btn btn-circle btn-ghost btn-xs text-info">
<label tabindex="0" class="text-info">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="w-4 h-4 stroke-current"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
</label>
<div tabindex="0" class="card compact dropdown-content dark:bg-info-content bg-slate-300 shadow rounded-box w-64">
@ -246,7 +246,7 @@ async function addAddress(acc: AccountEntry) {
</div>
</div>
</h3>
<p class="py-4">
<p class="py-4 max-h-60 overflow-y-auto">
<table>
<tr v-for="acc in availableAccount" >
<td>
@ -258,7 +258,7 @@ async function addAddress(acc: AccountEntry) {
</div>
<div>
<div class="font-bold capitalize">{{ acc.chainName }}</div>
<div class="text-sm opacity-50 hidden md:!block">{{ acc.address }}</div>
<div class="text-xs opacity-50 hidden md:!block">{{ acc.address }}</div>
</div>
</div>
</td>

View File

@ -31,9 +31,8 @@ export function scanCompatibleAccounts() {
const dashboard = useDashboard()
const available = [] as AccountEntry[]
scanLocalKeys().forEach(wallet => {
dashboard.favorite.forEach(chainName => {
const chain = dashboard.chains[chainName]
if (chain && wallet.hdPath.indexOf(chain.coinType) === 6) {
Object.values(dashboard.chains).forEach(chain => {
if (wallet.hdPath.indexOf(chain.coinType) === 6) {
const { data } = fromBech32(wallet.cosmosAddress)
available.push({
chainName: chain.chainName,