Skip to content
This repository was archived by the owner on Jul 26, 2023. It is now read-only.

Commit da4203f

Browse files
committed
fix(dock): fixing double launch of applications
Removing click from render option. Stopping propagation on ConfirmButton.
1 parent 1637f3e commit da4203f

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

packages/desktop-dock/src/components/Search/SearchRenderOption.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,7 @@ class SearchRenderOption extends React.PureComponent<ISearchRenderOptionProps> {
4343
const primary = display ?? name;
4444

4545
return (
46-
<ListItem
47-
ContainerProps={{ className: classes.root }}
48-
ContainerComponent="div"
49-
button
50-
dense
51-
selected={selected}
52-
onClick={this.onClick}
53-
>
46+
<ListItem ContainerProps={{ className: classes.root }} ContainerComponent="div" dense selected={selected}>
5447
{icon && (
5548
<ListItemIcon>
5649
<SearchResultIcon src={icon} />
@@ -73,16 +66,6 @@ class SearchRenderOption extends React.PureComponent<ISearchRenderOptionProps> {
7366
);
7467
}
7568

76-
private readonly onClick = async () => {
77-
try {
78-
const { applicationsStore, result } = this.props;
79-
80-
await applicationsStore?.launch(result);
81-
} catch (error) {
82-
console.error(`Failed to launch application: ${error}`);
83-
}
84-
};
85-
8669
private readonly remove = async () => {
8770
try {
8871
const { applicationsStore, result } = this.props;

packages/desktop-dock/src/components/System/ConfirmButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class ConfirmButton extends React.Component<IConfirmButtonProps> {
4545

4646
@action
4747
private readonly onClick = (event: React.MouseEvent) => {
48+
event.stopPropagation();
49+
4850
if (!this.confirm) {
4951
this.confirm = true;
5052

0 commit comments

Comments
 (0)