fix navbar and default select value

This commit is contained in:
Matthew Russell 2022-02-23 16:10:31 -08:00
parent ac4f833360
commit 3f9f97b1fa
2 changed files with 6 additions and 6 deletions

View File

@ -122,6 +122,8 @@ function useEagerConnect() {
return; return;
} }
// Use the connector string in local storage to find the right connector to auto
// connect to
const connector = Connectors[cfgObj.connector]; const connector = Connectors[cfgObj.connector];
// Developer hasn't provided this connector // Developer hasn't provided this connector

View File

@ -1,9 +1,7 @@
import { Callout, Button } from '@vegaprotocol/ui-toolkit'; import { Callout, Button } from '@vegaprotocol/ui-toolkit';
import { rest } from '../lib/connectors'; import { useVegaWallet } from '@vegaprotocol/react-helpers';
import { useVegaWallet, VegaKeyExtended } from '@vegaprotocol/react-helpers';
import { useEffect, useMemo, useState } from 'react'; import { useEffect, useMemo, useState } from 'react';
import { Connectors, rest } from '../lib/connectors'; import { Connectors } from '../lib/connectors';
import { LocalStorage } from '@vegaprotocol/storage';
export function Index() { export function Index() {
const { keypair, keypairs, selectPublicKey } = useVegaWallet(); const { keypair, keypairs, selectPublicKey } = useVegaWallet();
@ -28,7 +26,7 @@ export function Index() {
{keypairs?.length && ( {keypairs?.length && (
<select <select
name="change-key" name="change-key"
defaultValue="none" value={keypair ? keypair.pub : 'none'}
onChange={(e) => selectPublicKey(e.target.value)} onChange={(e) => selectPublicKey(e.target.value)}
> >
<option value="none" disabled={true}> <option value="none" disabled={true}>
@ -40,7 +38,7 @@ export function Index() {
</option> </option>
))} ))}
</select> </select>
)} ) : null}
<hr /> <hr />
<h2>Public keys</h2> <h2>Public keys</h2>
<pre>{JSON.stringify(keypairs, null, 2)}</pre> <pre>{JSON.stringify(keypairs, null, 2)}</pre>