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
|
@ -5183,8 +5183,8 @@ mod tests {
|
|||
};
|
||||
use fs::FakeFs;
|
||||
use gpui::{
|
||||
px, BorrowAppContext, DismissEvent, Empty, EventEmitter, FocusHandle, FocusableView,
|
||||
Render, TestAppContext, VisualTestContext,
|
||||
px, DismissEvent, Empty, EventEmitter, FocusHandle, FocusableView, Render, TestAppContext,
|
||||
UpdateGlobal, VisualTestContext,
|
||||
};
|
||||
use project::{Project, ProjectEntryId};
|
||||
use serde_json::json;
|
||||
|
@ -5606,7 +5606,7 @@ mod tests {
|
|||
|
||||
// Autosave on window change.
|
||||
item.update(cx, |item, cx| {
|
||||
cx.update_global(|settings: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |settings, cx| {
|
||||
settings.update_user_settings::<WorkspaceSettings>(cx, |settings| {
|
||||
settings.autosave = Some(AutosaveSetting::OnWindowChange);
|
||||
})
|
||||
|
@ -5626,7 +5626,7 @@ mod tests {
|
|||
// Autosave on focus change.
|
||||
item.update(cx, |item, cx| {
|
||||
cx.focus_self();
|
||||
cx.update_global(|settings: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |settings, cx| {
|
||||
settings.update_user_settings::<WorkspaceSettings>(cx, |settings| {
|
||||
settings.autosave = Some(AutosaveSetting::OnFocusChange);
|
||||
})
|
||||
|
@ -5649,7 +5649,7 @@ mod tests {
|
|||
|
||||
// Autosave after delay.
|
||||
item.update(cx, |item, cx| {
|
||||
cx.update_global(|settings: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |settings, cx| {
|
||||
settings.update_user_settings::<WorkspaceSettings>(cx, |settings| {
|
||||
settings.autosave = Some(AutosaveSetting::AfterDelay { milliseconds: 500 });
|
||||
})
|
||||
|
@ -5668,7 +5668,7 @@ mod tests {
|
|||
|
||||
// Autosave on focus change, ensuring closing the tab counts as such.
|
||||
item.update(cx, |item, cx| {
|
||||
cx.update_global(|settings: &mut SettingsStore, cx| {
|
||||
SettingsStore::update_global(cx, |settings, cx| {
|
||||
settings.update_user_settings::<WorkspaceSettings>(cx, |settings| {
|
||||
settings.autosave = Some(AutosaveSetting::OnFocusChange);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue