zed: Remove windows nightly channel toast (#48950)

Lukas Wirth created

It served its job

Release Notes:

- N/A *or* Added/Fixed/Improved ...

Change summary

crates/zed/src/zed.rs | 50 ---------------------------------------------
1 file changed, 50 deletions(-)

Detailed changes

crates/zed/src/zed.rs 🔗

@@ -412,9 +412,6 @@ pub fn initialize_workspace(
             }
         }
 
-        #[cfg(target_os = "windows")]
-        unstable_version_notification(cx);
-
         let edit_prediction_menu_handle = PopoverMenuHandle::default();
         let edit_prediction_ui = cx.new(|cx| {
             edit_prediction_ui::EditPredictionButton::new(
@@ -496,53 +493,6 @@ pub fn initialize_workspace(
     .detach();
 }
 
-#[cfg(target_os = "windows")]
-fn unstable_version_notification(cx: &mut App) {
-    if !matches!(
-        ReleaseChannel::try_global(cx),
-        Some(ReleaseChannel::Nightly)
-    ) {
-        return;
-    }
-    let db_key = "zed_windows_nightly_notif_shown_at".to_owned();
-    let time = chrono::Utc::now();
-    if let Some(last_shown) = db::kvp::KEY_VALUE_STORE
-        .read_kvp(&db_key)
-        .log_err()
-        .flatten()
-        .and_then(|timestamp| chrono::DateTime::parse_from_rfc3339(&timestamp).ok())
-    {
-        if time.fixed_offset() - last_shown < chrono::Duration::days(7) {
-            return;
-        }
-    }
-    cx.spawn(async move |_| {
-        db::kvp::KEY_VALUE_STORE
-            .write_kvp(db_key, time.to_rfc3339())
-            .await
-    })
-    .detach_and_log_err(cx);
-    struct WindowsNightly;
-    show_app_notification(NotificationId::unique::<WindowsNightly>(), cx, |cx| {
-        cx.new(|cx| {
-            MessageNotification::new("You're using an unstable version of Zed (Nightly)", cx)
-                .primary_message("Download Stable")
-                .primary_icon_color(Color::Accent)
-                .primary_icon(IconName::Download)
-                .primary_on_click(|window, cx| {
-                    window.dispatch_action(
-                        zed_actions::OpenBrowser {
-                            url: "https://zed.dev/download".to_string(),
-                        }
-                        .boxed_clone(),
-                        cx,
-                    );
-                    cx.emit(DismissEvent);
-                })
-        })
-    });
-}
-
 #[cfg(any(target_os = "linux", target_os = "freebsd"))]
 #[allow(unused)]
 fn initialize_file_watcher(window: &mut Window, cx: &mut Context<Workspace>) {