Skip to content

Commit e916fec

Browse files
fix: clear structure query should reset hexagon icon state
1 parent 7a55eb5 commit e916fec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/component/panels/databasePanel/DatabasePanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,9 @@ function DatabasePanelInner({
398398
});
399399
}, [dispatch, spectra]);
400400
const searchByStructureHandler = (idCodeValue: string) => {
401-
setIdCode(idCodeValue);
401+
const molecule = Molecule.fromIDCode(idCodeValue);
402+
const atoms = molecule.getAllAtoms();
403+
setIdCode(atoms > 0 ? idCodeValue : '');
402404
};
403405

404406
return (

0 commit comments

Comments
 (0)