Skip to content

Commit

Permalink
fix: refresh local molecule state after past a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
hamed-musallam committed Jan 25, 2024
1 parent a2a95b4 commit 1162900
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ interface MoleculePanelHeaderProps {
onOpenMoleculeEditor: () => void;
renderSource?: 'moleculePanel' | 'predictionPanel';
onClickPreferences?: () => void;
onClickPastMolecule?: () => void;
children?: ReactNode;
}

Expand All @@ -98,6 +99,7 @@ export default function MoleculePanelHeader({
onOpenMoleculeEditor,
renderSource = 'moleculePanel',
onClickPreferences,
onClickPastMolecule,
children,
}: MoleculePanelHeaderProps) {
const { rootRef } = useGlobal();
Expand Down Expand Up @@ -169,6 +171,7 @@ export default function MoleculePanelHeader({
);

function handlePasteMolfileAction() {
onClickPastMolecule?.();
void readText().then(handlePasteMolfile);
}
async function handlePasteMolfile(molfile: string | undefined) {
Expand Down
3 changes: 3 additions & 0 deletions src/component/panels/predictionPanel/PredictionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ export default function PredictionPanel() {
renderSource="predictionPanel"
onClickPreferences={settingsPanelHandler}
onOpenMoleculeEditor={() => openMoleculeEditor()}
onClickPastMolecule={() => {
refreshSlider.current = true;
}}
>
<PredictionSimpleOptions />
</MoleculePanelHeader>
Expand Down

0 comments on commit 1162900

Please sign in to comment.