Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DevTracker showing empty view on search #169

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/extension/panelControllers/trackerPanelController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
}
}
}
3 changes: 2 additions & 1 deletion src/panel/components/tracker/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default function Search({ searchHistory, onSearch }: Props) {
return (
<form
style={formStyle}
onSubmit={() => {
onSubmit={(e) => {
e.preventDefault();
onSearch(searchInput);
setSearchInput("");
}}
Expand Down