Fix different kinds values used for worktree_id (#17523)

This commit is contained in:
Kirill Bulatov 2024-09-07 00:51:09 -04:00 committed by GitHub
parent 47aec5e64d
commit 8985fd87c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 136 additions and 127 deletions

View file

@ -249,7 +249,7 @@ impl SettingsObserver {
let store = cx.global::<SettingsStore>();
for worktree in self.worktree_store.read(cx).worktrees() {
let worktree_id = worktree.read(cx).id().to_proto();
for (path, content) in store.local_settings(worktree.entity_id().as_u64() as usize) {
for (path, content) in store.local_settings(worktree.read(cx).id()) {
downstream_client
.send(proto::UpdateWorktreeSettings {
project_id,
@ -416,17 +416,12 @@ impl SettingsObserver {
settings_contents: impl IntoIterator<Item = (Arc<Path>, Option<String>)>,
cx: &mut ModelContext<Self>,
) {
let worktree_id = worktree.entity_id();
let worktree_id = worktree.read(cx).id();
let remote_worktree_id = worktree.read(cx).id();
cx.update_global::<SettingsStore, _>(|store, cx| {
for (directory, file_content) in settings_contents {
store
.set_local_settings(
worktree_id.as_u64() as usize,
directory.clone(),
file_content.as_deref(),
cx,
)
.set_local_settings(worktree_id, directory.clone(), file_content.as_deref(), cx)
.log_err();
if let Some(downstream_client) = &self.downstream_client {
downstream_client