Add the channel name into the current call

This commit is contained in:
Mikayla 2023-08-15 10:45:03 -07:00
parent fafc10d57c
commit 9e99b74fce
No known key found for this signature in database

View File

@ -34,9 +34,9 @@ use project::{Fs, Project};
use serde_derive::{Deserialize, Serialize};
use settings::SettingsStore;
use staff_mode::StaffMode;
use std::{mem, sync::Arc};
use std::{borrow::Cow, mem, sync::Arc};
use theme::IconButton;
use util::{ResultExt, TryFutureExt};
use util::{iife, ResultExt, TryFutureExt};
use workspace::{
dock::{DockPosition, Panel},
item::ItemHandle,
@ -1181,13 +1181,35 @@ impl CollabPanel {
let tooltip_style = &theme.tooltip;
let text = match section {
Section::ActiveCall => "Current Call",
Section::ContactRequests => "Requests",
Section::Contacts => "Contacts",
Section::Channels => "Channels",
Section::ChannelInvites => "Invites",
Section::Online => "Online",
Section::Offline => "Offline",
Section::ActiveCall => {
let channel_name = iife!({
let channel_id = ActiveCall::global(cx)
.read(cx)
.room()?
.read(cx)
.channel_id()?;
let name = self
.channel_store
.read(cx)
.channel_for_id(channel_id)?
.name
.as_str();
Some(name)
});
if let Some(name) = channel_name {
Cow::Owned(format!("Current Call - #{}", name))
} else {
Cow::Borrowed("Current Call")
}
}
Section::ContactRequests => Cow::Borrowed("Requests"),
Section::Contacts => Cow::Borrowed("Contacts"),
Section::Channels => Cow::Borrowed("Channels"),
Section::ChannelInvites => Cow::Borrowed("Invites"),
Section::Online => Cow::Borrowed("Online"),
Section::Offline => Cow::Borrowed("Offline"),
};
enum AddContact {}