Use preview server when not on stable

This commit is contained in:
Nathan Sobo 2023-08-29 10:07:22 -06:00
parent ea0e5e880e
commit 2d411303bb

View file

@ -1011,9 +1011,9 @@ impl Client {
credentials: &Credentials, credentials: &Credentials,
cx: &AsyncAppContext, cx: &AsyncAppContext,
) -> Task<Result<Connection, EstablishConnectionError>> { ) -> Task<Result<Connection, EstablishConnectionError>> {
let is_preview = cx.read(|cx| { let use_preview_server = cx.read(|cx| {
if cx.has_global::<ReleaseChannel>() { if cx.has_global::<ReleaseChannel>() {
*cx.global::<ReleaseChannel>() == ReleaseChannel::Preview *cx.global::<ReleaseChannel>() != ReleaseChannel::Stable
} else { } else {
false false
} }
@ -1028,7 +1028,7 @@ impl Client {
let http = self.http.clone(); let http = self.http.clone();
cx.background().spawn(async move { cx.background().spawn(async move {
let mut rpc_url = Self::get_rpc_url(http, is_preview).await?; let mut rpc_url = Self::get_rpc_url(http, use_preview_server).await?;
let rpc_host = rpc_url let rpc_host = rpc_url
.host_str() .host_str()
.zip(rpc_url.port_or_known_default()) .zip(rpc_url.port_or_known_default())