Hide subscribe button for community when not logged in

This commit is contained in:
Bnyro 2023-06-26 13:37:38 +02:00
parent 7494340afb
commit 12e5ef6dce
1 changed files with 25 additions and 17 deletions

View File

@ -79,6 +79,10 @@ impl SimpleComponent for CommunityPage {
set_text: &format!("{} subscribers", model.info.counts.subscribers),
set_margin_end: 10,
},
if settings::get_current_account().jwt.is_some() {
gtk::Box {
set_orientation: gtk::Orientation::Horizontal,
match model.info.subscribed {
SubscribedType::Subscribed => {
gtk::Button {
@ -98,6 +102,10 @@ impl SimpleComponent for CommunityPage {
}
}
},
}
} else {
gtk::Box {}
},
gtk::Label {
#[watch]
set_text: &format!("{} posts, {} comments", model.info.counts.posts, model.info.counts.comments),