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
|
@ -943,7 +943,8 @@ fn watch_languages(_fs: Arc<dyn fs::Fs>, _languages: Arc<LanguageRegistry>, _cx:
|
|||
fn watch_file_types(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
||||
use std::time::Duration;
|
||||
|
||||
use gpui::BorrowAppContext;
|
||||
use file_icons::FileIcons;
|
||||
use gpui::UpdateGlobal;
|
||||
|
||||
let path = {
|
||||
let p = Path::new("assets/icons/file_icons/file_types.json");
|
||||
|
@ -957,7 +958,7 @@ fn watch_file_types(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
|||
let mut events = fs.watch(path.as_path(), Duration::from_millis(100)).await;
|
||||
while (events.next().await).is_some() {
|
||||
cx.update(|cx| {
|
||||
cx.update_global(|file_types, _| {
|
||||
FileIcons::update_global(cx, |file_types, _cx| {
|
||||
*file_types = file_icons::FileIcons::new(Assets);
|
||||
});
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue