Add DelayMs type for settings (#40659)
Closes #40610 Release Notes: - N/A
This commit is contained in:
@@ -811,7 +811,7 @@ impl<T: Item> ItemHandle for Entity<T> {
|
||||
let autosave = item.workspace_settings(cx).autosave;
|
||||
|
||||
if let AutosaveSetting::AfterDelay { milliseconds } = autosave {
|
||||
let delay = Duration::from_millis(milliseconds);
|
||||
let delay = Duration::from_millis(milliseconds.0);
|
||||
let item = item.clone();
|
||||
pending_autosave.fire_new(
|
||||
delay,
|
||||
|
||||
@@ -8799,8 +8799,9 @@ mod tests {
|
||||
item.update(cx, |item, cx| {
|
||||
SettingsStore::update_global(cx, |settings, cx| {
|
||||
settings.update_user_settings(cx, |settings| {
|
||||
settings.workspace.autosave =
|
||||
Some(AutosaveSetting::AfterDelay { milliseconds: 500 });
|
||||
settings.workspace.autosave = Some(AutosaveSetting::AfterDelay {
|
||||
milliseconds: 500.into(),
|
||||
});
|
||||
})
|
||||
});
|
||||
item.is_dirty = true;
|
||||
|
||||
Reference in New Issue
Block a user