diff --git a/src/extension.ts b/src/extension.ts index 9cec52d..ddac569 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,8 +1,7 @@ import * as vscode from 'vscode'; -import { ExtensionContext } from 'vscode'; import { WebviewViewProvider } from './webviewPovider'; -export function activate(context: ExtensionContext) { +export function activate(context: vscode.ExtensionContext) { const provider = new WebviewViewProvider(context); context.subscriptions.push( vscode.window.registerWebviewViewProvider( diff --git a/src/webview/src/components/Account.tsx b/src/webview/src/components/Account.tsx index 7cd2065..cbf3f78 100644 --- a/src/webview/src/components/Account.tsx +++ b/src/webview/src/components/Account.tsx @@ -80,6 +80,7 @@ export const Account = ({ client }: { client: SuiClient | undefined }) => { useEffect(() => { const updateBalance = async () => { + state.account && setNetwork(() => state.account!.nonce.network); const balance = await getBalance(client, state.account); setState((oldState) => ({ ...oldState, balance })); }; @@ -183,9 +184,9 @@ export const Account = ({ client }: { client: SuiClient | undefined }) => { setNetwork((e.target as HTMLInputElement).value as NETWORK); }} > - {NETWORKS.map((network, index) => ( - - {network} + {NETWORKS.map((item, index) => ( + + {item} ))}