Use UpdateGlobal
accessors in more places (#11925)
This PR updates a number of instances that were previously using `cx.update_global` to use `UpdateGlobal::update_global` instead. Release Notes: - N/A
This commit is contained in:
parent
c1e291bc96
commit
13bbaf1e18
20 changed files with 66 additions and 68 deletions
|
@ -2,7 +2,7 @@ use crate::{settings_store::SettingsStore, Settings};
|
|||
use anyhow::{Context, Result};
|
||||
use fs::Fs;
|
||||
use futures::{channel::mpsc, StreamExt};
|
||||
use gpui::{AppContext, BackgroundExecutor, BorrowAppContext};
|
||||
use gpui::{AppContext, BackgroundExecutor, UpdateGlobal};
|
||||
use std::{io::ErrorKind, path::PathBuf, sync::Arc, time::Duration};
|
||||
use util::{paths, ResultExt};
|
||||
|
||||
|
@ -70,7 +70,7 @@ pub fn handle_settings_file_changes(
|
|||
.background_executor()
|
||||
.block(user_settings_file_rx.next())
|
||||
.unwrap();
|
||||
cx.update_global(|store: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |store, cx| {
|
||||
store
|
||||
.set_user_settings(&user_settings_content, cx)
|
||||
.log_err();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use anyhow::{anyhow, Context, Result};
|
||||
use collections::{btree_map, hash_map, BTreeMap, HashMap};
|
||||
use gpui::{AppContext, AsyncAppContext, BorrowAppContext, Global};
|
||||
use gpui::{AppContext, AsyncAppContext, BorrowAppContext, Global, UpdateGlobal};
|
||||
use lazy_static::lazy_static;
|
||||
use schemars::{gen::SchemaGenerator, schema::RootSchema, JsonSchema};
|
||||
use serde::{de::DeserializeOwned, Deserialize as _, Serialize};
|
||||
|
@ -49,7 +49,7 @@ pub trait Settings: 'static + Send + Sync {
|
|||
where
|
||||
Self: Sized,
|
||||
{
|
||||
cx.update_global(|store: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |store, cx| {
|
||||
store.register_setting::<Self>(cx);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue