Hide subscribe button for community when not logged in
This commit is contained in:
parent
7494340afb
commit
12e5ef6dce
|
@ -79,24 +79,32 @@ impl SimpleComponent for CommunityPage {
|
||||||
set_text: &format!("{} subscribers", model.info.counts.subscribers),
|
set_text: &format!("{} subscribers", model.info.counts.subscribers),
|
||||||
set_margin_end: 10,
|
set_margin_end: 10,
|
||||||
},
|
},
|
||||||
match model.info.subscribed {
|
if settings::get_current_account().jwt.is_some() {
|
||||||
SubscribedType::Subscribed => {
|
gtk::Box {
|
||||||
gtk::Button {
|
set_orientation: gtk::Orientation::Horizontal,
|
||||||
set_label: "Unsubscribe",
|
|
||||||
connect_clicked => CommunityInput::ToggleSubscription,
|
match model.info.subscribed {
|
||||||
}
|
SubscribedType::Subscribed => {
|
||||||
}
|
gtk::Button {
|
||||||
SubscribedType::NotSubscribed => {
|
set_label: "Unsubscribe",
|
||||||
gtk::Button {
|
connect_clicked => CommunityInput::ToggleSubscription,
|
||||||
set_label: "Subscribe",
|
}
|
||||||
connect_clicked => CommunityInput::ToggleSubscription,
|
}
|
||||||
}
|
SubscribedType::NotSubscribed => {
|
||||||
}
|
gtk::Button {
|
||||||
SubscribedType::Pending => {
|
set_label: "Subscribe",
|
||||||
gtk::Label {
|
connect_clicked => CommunityInput::ToggleSubscription,
|
||||||
set_label: "Subscription pending",
|
}
|
||||||
}
|
}
|
||||||
|
SubscribedType::Pending => {
|
||||||
|
gtk::Label {
|
||||||
|
set_label: "Subscription pending",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
gtk::Box {}
|
||||||
},
|
},
|
||||||
gtk::Label {
|
gtk::Label {
|
||||||
#[watch]
|
#[watch]
|
||||||
|
|
Loading…
Reference in New Issue