feat: Redesign New Chat (#31)
* make subject is optional * redesign * search * fix * adjust
This commit is contained in:
@@ -27,6 +27,10 @@ impl Account {
|
||||
cx.global::<GlobalAccount>().0.clone()
|
||||
}
|
||||
|
||||
pub fn get_global(cx: &App) -> &Self {
|
||||
cx.global::<GlobalAccount>().0.read(cx)
|
||||
}
|
||||
|
||||
pub fn set_global(account: Entity<Self>, cx: &mut App) {
|
||||
cx.set_global(GlobalAccount(account));
|
||||
}
|
||||
@@ -162,6 +166,11 @@ impl Account {
|
||||
.detach();
|
||||
}
|
||||
|
||||
/// Get the reference to profile.
|
||||
pub fn profile_ref(&self) -> Option<&Profile> {
|
||||
self.profile.as_ref()
|
||||
}
|
||||
|
||||
/// Sets the profile for the account.
|
||||
pub fn profile(&mut self, profile: Profile, cx: &mut Context<Self>) {
|
||||
self.profile = Some(profile);
|
||||
|
||||
Reference in New Issue
Block a user