mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Add the channel name into the current call
This commit is contained in:
parent
fafc10d57c
commit
9e99b74fce
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user