Skip to content

Commit 1542a3a

Browse files
authored
Merge pull request #662 from multiplex55/codex/fix-mutable-borrow-errors-in-dashboard_editor_dialog
Fix confirm-remove dialog close handling
2 parents ffac643 + c4253a9 commit 1542a3a

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/gui/dashboard_editor_dialog.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ impl DashboardEditorDialog {
228228
if let Some(slot) = self.config.slots.get(idx) {
229229
let label = Self::slot_label(slot);
230230
let mut open = true;
231+
let mut should_close = false;
231232
egui::Window::new("Confirm remove")
232233
.collapsible(false)
233234
.resizable(false)
@@ -237,13 +238,16 @@ impl DashboardEditorDialog {
237238
ui.horizontal(|ui| {
238239
if ui.button("Remove").clicked() {
239240
confirm_remove = Some(idx);
240-
open = false;
241+
should_close = true;
241242
}
242243
if ui.button("Cancel").clicked() {
243-
open = false;
244+
should_close = true;
244245
}
245246
});
246247
});
248+
if should_close {
249+
open = false;
250+
}
247251
if !open {
248252
self.confirm_remove_slot = None;
249253
}
@@ -255,7 +259,7 @@ impl DashboardEditorDialog {
255259
while idx < self.config.slots.len() {
256260
let original_slot = self.config.slots[idx].clone();
257261
let mut slot = original_slot.clone();
258-
let mut removed = confirm_remove == Some(idx);
262+
let removed = confirm_remove == Some(idx);
259263
let mut edited = false;
260264
let mut swapped = false;
261265
ui.push_id(idx, |ui| {

0 commit comments

Comments
 (0)