From 1a0eedb7878edeb8c7521e3ba1ff2d863276d8e2 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Mon, 12 May 2025 07:46:18 -0700 Subject: [PATCH] Fix migrate banner not showing markdown on file changes (#30575) Fixes case where on file (settings/keymap) changes banner would appear but markdown was not visible. Regression caused by refactor happened in https://github.com/zed-industries/zed/pull/30456. Release Notes: - N/A --- crates/zed/src/zed/migrate.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/zed/src/zed/migrate.rs b/crates/zed/src/zed/migrate.rs index 118b71c89f..0adee2bf4a 100644 --- a/crates/zed/src/zed/migrate.rs +++ b/crates/zed/src/zed/migrate.rs @@ -76,15 +76,15 @@ impl MigrationBanner { migration_type, migrated, } => { - if self.migration_type == Some(*migration_type) { - let location = if *migrated { - ToolbarItemLocation::Secondary - } else { - ToolbarItemLocation::Hidden - }; - cx.emit(ToolbarItemEvent::ChangeLocation(location)); - cx.notify(); - } + if *migrated { + self.migration_type = Some(*migration_type); + self.show(cx); + } else { + cx.emit(ToolbarItemEvent::ChangeLocation( + ToolbarItemLocation::Hidden, + )); + self.reset(cx); + }; } } }