Merge pull request #1661 from LemmyNet/subscribe-fix
Fix subscribe and block community buttons not showing up on first load
This commit is contained in:
commit
314aa796c0
1 changed files with 22 additions and 26 deletions
|
@ -260,20 +260,18 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
subscribe() {
|
subscribe() {
|
||||||
const community_view = this.props.community_view;
|
const community_view = this.props.community_view;
|
||||||
return (
|
return (
|
||||||
<>
|
community_view.subscribed === "NotSubscribed" && (
|
||||||
{community_view.subscribed == "NotSubscribed" && (
|
<button
|
||||||
<button
|
className="btn btn-secondary d-block mb-2 w-100"
|
||||||
className="btn btn-secondary d-block mb-2 w-100"
|
onClick={linkEvent(this, this.handleFollowCommunity)}
|
||||||
onClick={linkEvent(this, this.handleFollowCommunity)}
|
>
|
||||||
>
|
{this.state.followCommunityLoading ? (
|
||||||
{this.state.followCommunityLoading ? (
|
<Spinner />
|
||||||
<Spinner />
|
) : (
|
||||||
) : (
|
I18NextService.i18n.t("subscribe")
|
||||||
I18NextService.i18n.t("subscribe")
|
)}
|
||||||
)}
|
</button>
|
||||||
</button>
|
)
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,18 +279,16 @@ export class Sidebar extends Component<SidebarProps, SidebarState> {
|
||||||
const { subscribed, blocked } = this.props.community_view;
|
const { subscribed, blocked } = this.props.community_view;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
subscribed === "NotSubscribed" && (
|
||||||
{subscribed == "NotSubscribed" && (
|
<button
|
||||||
<button
|
className="btn btn-danger d-block mb-2 w-100"
|
||||||
className="btn btn-danger d-block mb-2 w-100"
|
onClick={linkEvent(this, this.handleBlockCommunity)}
|
||||||
onClick={linkEvent(this, this.handleBlockCommunity)}
|
>
|
||||||
>
|
{I18NextService.i18n.t(
|
||||||
{I18NextService.i18n.t(
|
blocked ? "unblock_community" : "block_community"
|
||||||
blocked ? "unblock_community" : "block_community"
|
)}
|
||||||
)}
|
</button>
|
||||||
</button>
|
)
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue