# settings_ui: Fix editable project settings not being updated when a new workspace is created \(\#47992\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fe653a77aef9cda5521958ad5b58d3d33c6aff20)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fe653a77aef9cda5521958ad5b58d3d33c6aff20

Requested commit: fe653a77aef9cda5521958ad5b58d3d33c6aff20

Commit: fe653a77aef9cda5521958ad5b58d3d33c6aff20

Tree: befb36ae63673593ebeba54134479bcb67fa013b

Author: Anthony Eid

Committer: GitHub

## Message

```
settings_ui: Fix editable project settings not being updated when a new workspace is created (#47992)

The bug occurred because `cx.observe_new::<Workspace>` would pass a
mutable `Window` that was also the new workspace's window. Later,
`fetch_files` would fail to read the newly created workspace from
`WorkspaceStore` because its window already had a mutable reference to
it.

The fix always passes the Settings UI's window handle to the
`fetch_files` function, and uses a `settings_window_handle.defer`
callback to call `fetch_files` after the newly created workspace's
window no longer has any mutable references to it.

Release Notes:

- settings_ui: Fixed editable project settings not being updated when a
new workspace is created
```

## Parents

- [609e915b10833210b3d3905e636dd36c394de46a](https://git.cafe/gitcafe/zed/commit/609e915b10833210b3d3905e636dd36c394de46a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fe653a77aef9cda5521958ad5b58d3d33c6aff20?format=markdown)
