# collab_panel: Fix favorite channels not surviving startup \(\#52541\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 1625f98fb063faac06fdbdbb14a1b9d904e3a7db

Requested commit: 1625f98fb063faac06fdbdbb14a1b9d904e3a7db

Commit: 1625f98fb063faac06fdbdbb14a1b9d904e3a7db

Tree: 68585ec29bf39b5809d1054d792a61797b90b684

Author: Danilo Leal

Committer: GitHub

## Message

```
collab_panel: Fix favorite channels not surviving startup (#52541)

Follow up to https://github.com/zed-industries/zed/pull/52378

This PR fixes a little race condition that was happening where we were
running the favorite channel pruning function faster than the channels
could load, leading to favorite channels not surviving the app
restarting. The fix is to make the pruning happen only when the number
of channels is bigger than 0, which means the list from the server has
already been loaded.
Release Notes:

- N/A _(No release notes yet because this feature hasn't reached the
wider public)_
```

## Parents

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

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