diff --git a/src/components/community_page.rs b/src/components/community_page.rs index 93780f6..ae21b21 100644 --- a/src/components/community_page.rs +++ b/src/components/community_page.rs @@ -79,24 +79,32 @@ impl SimpleComponent for CommunityPage { set_text: &format!("{} subscribers", model.info.counts.subscribers), set_margin_end: 10, }, - match model.info.subscribed { - SubscribedType::Subscribed => { - gtk::Button { - set_label: "Unsubscribe", - connect_clicked => CommunityInput::ToggleSubscription, - } - } - SubscribedType::NotSubscribed => { - gtk::Button { - set_label: "Subscribe", - connect_clicked => CommunityInput::ToggleSubscription, - } - } - SubscribedType::Pending => { - gtk::Label { - set_label: "Subscription pending", - } + if settings::get_current_account().jwt.is_some() { + gtk::Box { + set_orientation: gtk::Orientation::Horizontal, + + match model.info.subscribed { + SubscribedType::Subscribed => { + gtk::Button { + set_label: "Unsubscribe", + connect_clicked => CommunityInput::ToggleSubscription, + } + } + SubscribedType::NotSubscribed => { + gtk::Button { + set_label: "Subscribe", + connect_clicked => CommunityInput::ToggleSubscription, + } + } + SubscribedType::Pending => { + gtk::Label { + set_label: "Subscription pending", + } + } + }, } + } else { + gtk::Box {} }, gtk::Label { #[watch]