diff --git a/src/extension/panelControllers/trackerPanelController.ts b/src/extension/panelControllers/trackerPanelController.ts index a527bdd..67a4762 100644 --- a/src/extension/panelControllers/trackerPanelController.ts +++ b/src/extension/panelControllers/trackerPanelController.ts @@ -266,22 +266,28 @@ export default class TrackerPanelController extends PanelControllerBase< return; } + var success = false; try { const block = await this.blockchainMonitor.getBlock(query, false); if (block) { request.selectBlock = block.hash; + success = true; } } catch { try { const tx = await this.getTransaction(query.toLowerCase(), false); if (tx) { request.selectTransaction = tx.tx.hash; + success = true; } } catch { - vscode.window.showErrorMessage( - `Could not retrieve block or transaction with hash ${query}` - ); + success = false; } } + if (!success) { + vscode.window.showErrorMessage( + `Could not retrieve block or transaction with hash ${query}` + ); + } } } diff --git a/src/panel/components/tracker/Search.tsx b/src/panel/components/tracker/Search.tsx index ef09349..e0e0afe 100644 --- a/src/panel/components/tracker/Search.tsx +++ b/src/panel/components/tracker/Search.tsx @@ -35,7 +35,8 @@ export default function Search({ searchHistory, onSearch }: Props) { return (