Upgrade inferno v8.0.0 try2 (#790)

* Upgrade non-breaking deps.

* Upgrade to Inferno v8. Fixes #731

* Upgrading inferno-i18next-dess
This commit is contained in:
Dessalines 2022-09-22 11:03:35 -04:00 committed by GitHub
parent cc90ded31e
commit 6320357d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 2960 additions and 2641 deletions

View file

@ -139,24 +139,27 @@ export class Community extends Component<any, State> {
// Only fetch the data if coming from another route
if (this.isoData.path == this.context.router.route.match.url) {
this.state.communityRes = Some(
this.isoData.routeData[0] as GetCommunityResponse
);
this.state = {
...this.state,
communityRes: Some(this.isoData.routeData[0] as GetCommunityResponse),
};
let postsRes = Some(this.isoData.routeData[1] as GetPostsResponse);
let commentsRes = Some(this.isoData.routeData[2] as GetCommentsResponse);
postsRes.match({
some: pvs => (this.state.posts = pvs.posts),
none: void 0,
});
commentsRes.match({
some: cvs => (this.state.comments = cvs.comments),
none: void 0,
});
if (postsRes.isSome()) {
this.state = { ...this.state, posts: postsRes.unwrap().posts };
}
this.state.communityLoading = false;
this.state.postsLoading = false;
this.state.commentsLoading = false;
if (commentsRes.isSome()) {
this.state = { ...this.state, comments: commentsRes.unwrap().comments };
}
this.state = {
...this.state,
communityLoading: false,
postsLoading: false,
commentsLoading: false,
};
} else {
this.fetchCommunity();
this.fetchData();
@ -278,7 +281,7 @@ export class Community extends Component<any, State> {
render() {
return (
<div class="container">
<div className="container">
{this.state.communityLoading ? (
<h5>
<Spinner large />
@ -294,12 +297,12 @@ export class Community extends Component<any, State> {
image={res.community_view.community.icon}
/>
<div class="row">
<div class="col-12 col-md-8">
<div className="row">
<div className="col-12 col-md-8">
{this.communityInfo()}
<div class="d-block d-md-none">
<div className="d-block d-md-none">
<button
class="btn btn-secondary d-inline-block mb-2 mr-3"
className="btn btn-secondary d-inline-block mb-2 mr-3"
onClick={linkEvent(this, this.handleShowSidebarMobile)}
>
{i18n.t("sidebar")}{" "}
@ -344,7 +347,7 @@ export class Community extends Component<any, State> {
onChange={this.handlePageChange}
/>
</div>
<div class="d-none d-md-block col-md-4">
<div className="d-none d-md-block col-md-4">
<Sidebar
community_view={res.community_view}
moderators={res.moderators}
@ -413,9 +416,9 @@ export class Community extends Component<any, State> {
.map(r => r.community_view.community)
.match({
some: community => (
<div class="mb-2">
<div className="mb-2">
<BannerIconHeader banner={community.banner} icon={community.icon} />
<h5 class="mb-0 overflow-wrap-anywhere">{community.title}</h5>
<h5 className="mb-0 overflow-wrap-anywhere">{community.title}</h5>
<CommunityLink
community={community}
realLink
@ -434,14 +437,14 @@ export class Community extends Component<any, State> {
communityRSSUrl(r.community_view.community.actor_id, this.state.sort)
);
return (
<div class="mb-3">
<span class="mr-3">
<div className="mb-3">
<span className="mr-3">
<DataTypeSelect
type_={this.state.dataType}
onChange={this.handleDataTypeChange}
/>
</span>
<span class="mr-2">
<span className="mr-2">
<SortSelect sort={this.state.sort} onChange={this.handleSortChange} />
</span>
{communityRss.match({
@ -475,8 +478,7 @@ export class Community extends Component<any, State> {
}
handleShowSidebarMobile(i: Community) {
i.state.showSidebarMobile = !i.state.showSidebarMobile;
i.setState(i.state);
i.setState({ showSidebarMobile: !i.state.showSidebarMobile });
}
updateUrl(paramUpdates: UrlParams) {
@ -543,9 +545,7 @@ export class Community extends Component<any, State> {
this.fetchData();
} else if (op == UserOperation.GetCommunity) {
let data = wsJsonToRes<GetCommunityResponse>(msg, GetCommunityResponse);
this.state.communityRes = Some(data);
this.state.communityLoading = false;
this.setState(this.state);
this.setState({ communityRes: Some(data), communityLoading: false });
// TODO why is there no auth in this form?
WebSocketService.Instance.send(
wsClient.communityJoin({
@ -576,9 +576,7 @@ export class Community extends Component<any, State> {
this.setState(this.state);
} else if (op == UserOperation.GetPosts) {
let data = wsJsonToRes<GetPostsResponse>(msg, GetPostsResponse);
this.state.posts = data.posts;
this.state.postsLoading = false;
this.setState(this.state);
this.setState({ posts: data.posts, postsLoading: false });
restoreScrollPosition(this.context);
setupTippy();
} else if (
@ -631,9 +629,7 @@ export class Community extends Component<any, State> {
this.setState(this.state);
} else if (op == UserOperation.GetComments) {
let data = wsJsonToRes<GetCommentsResponse>(msg, GetCommentsResponse);
this.state.comments = data.comments;
this.state.commentsLoading = false;
this.setState(this.state);
this.setState({ comments: data.comments, commentsLoading: false });
} else if (
op == UserOperation.EditComment ||
op == UserOperation.DeleteComment ||