Fix selecting and deleting user toolchains (#39068)
I was trying to use the new user toolchains but every time I clicked on one I had added, it would delete it from the picker. Ironically, it wouldn't delete it permanently when I tried to by clicking on the trash can icon. Every time I reopened the workspace all user toolchains were there. Release Notes: - Fixed selecting and deleting user toolchains.
This commit is contained in:
@@ -1047,8 +1047,8 @@ impl PickerDelegate for ToolchainSelectorDelegate {
|
||||
let toolchain = toolchain.clone();
|
||||
let scope = scope.clone();
|
||||
|
||||
this.end_slot(IconButton::new(id, IconName::Trash))
|
||||
.on_click(cx.listener(move |this, _, _, cx| {
|
||||
this.end_slot(IconButton::new(id, IconName::Trash).on_click(cx.listener(
|
||||
move |this, _, _, cx| {
|
||||
this.delegate.project.update(cx, |this, cx| {
|
||||
this.remove_toolchain(toolchain.clone(), scope.clone(), cx)
|
||||
});
|
||||
@@ -1076,7 +1076,8 @@ impl PickerDelegate for ToolchainSelectorDelegate {
|
||||
}
|
||||
cx.stop_propagation();
|
||||
cx.notify();
|
||||
}))
|
||||
},
|
||||
)))
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user