Skip to content

Commit

Permalink
fix: refactored onrecentworkspace click
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Aug 26, 2024
1 parent e7f7cb1 commit dd9d739
Showing 1 changed file with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,20 @@ const RecentWorkspace = observer(({ workspace }: TRecentWorkspaceProps) => {
updateXmlValuesOnStrategySelection,
} = load_modal;

const onRecentWorkspaceClick = () => {
if (selected_strategy_id === workspace.id) return;
setLoading(true);
loadStrategyOnModalRecentPreview(workspace.id);
updateXmlValuesOnStrategySelection();
};

return (
<div
className={classnames('load-strategy__recent-item', {
'load-strategy__recent-item--selected': selected_strategy_id === workspace.id,
})}
key={workspace.id}
onClick={
selected_strategy_id === workspace.id
? undefined
: () => {
setLoading(true);
loadStrategyOnModalRecentPreview(workspace.id);
updateXmlValuesOnStrategySelection();
}
}
onClick={onRecentWorkspaceClick}
data-testid='dt_recent_workspace_item'
>
<div className='load-strategy__recent-item-text'>
Expand Down

0 comments on commit dd9d739

Please sign in to comment.