mirror of https://github.com/casbin/casnode.git
Fix some JS warnings
This commit is contained in:
parent
f308fe932d
commit
62b058eb5e
|
@ -27,7 +27,7 @@ class AuthCallback extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.login();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class SearchResultPage extends React.Component {
|
|||
SearchBackend.search(this.state.keyword).then((res) => this.updateSearchResult(res));
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.props.history.listen((route) => {
|
||||
const params = route.search.split("=");
|
||||
if (params.length < 2) {
|
||||
|
|
|
@ -24,7 +24,7 @@ class SigninPage extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
Setting.goToLink(Setting.getSigninUrl());
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,7 @@ class TopicPage extends React.Component {
|
|||
|
||||
renderTab(tab) {
|
||||
return (
|
||||
<a href="javascript:void(0)" onClick={() => this.changeTab(tab?.id)} className={this.state.tab === tab?.id ? "tab_current" : "tab"}>
|
||||
<a key={tab?.id} href="javascript:void(0)" onClick={() => this.changeTab(tab?.id)} className={this.state.tab === tab?.id ? "tab_current" : "tab"}>
|
||||
{tab?.name}
|
||||
</a>
|
||||
);
|
||||
|
|
|
@ -62,7 +62,7 @@ class NewBox extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
this.getNodes();
|
||||
MemberBackend.getMemberEditorType().then((res) => {
|
||||
const editorType = res.data ? res.data : Conf.DefaultEditorType;
|
||||
|
|
|
@ -66,7 +66,7 @@ class NewNodeTopicBox extends React.Component {
|
|||
this.publishTopic = this.publishTopic.bind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
MemberBackend.getMemberEditorType().then((res) => {
|
||||
const editorType = res.data ? res.data : Conf.DefaultEditorType;
|
||||
this.updateFormField("editorType", editorType);
|
||||
|
|
|
@ -60,7 +60,7 @@ class NewReplyBox extends React.Component {
|
|||
this.synonyms = this.synonyms.bind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
UNSAFE_componentWillMount() {
|
||||
MemberBackend.getMemberEditorType().then((res) => {
|
||||
const editorType = res.data ? res.data : Conf.DefaultEditorType;
|
||||
this.updateFormField("editorType", editorType);
|
||||
|
|
|
@ -42,7 +42,7 @@ class RightFavouriteBox extends React.Component {
|
|||
|
||||
renderNodes(node) {
|
||||
return (
|
||||
<div className="node rightFavorite">
|
||||
<div key={node?.id} className="node rightFavorite">
|
||||
<div className="node_compose rightFavorite">
|
||||
<Link to={`/new/${node?.id}`} id="linkCompose">
|
||||
<img src={Setting.getStatic("/img/compose.png")} align="absmiddle" border="0" width="23" height="18" alt="New Topic" />
|
||||
|
@ -52,9 +52,9 @@ class RightFavouriteBox extends React.Component {
|
|||
<div id="avatar" style={{backgroundImage: `url(${node?.image})`}} className="rightFavorite" />
|
||||
</Link>
|
||||
{" "}
|
||||
<linkTitle to={`/go/${encodeURIComponent(node?.id)}`} id="linkTitle">
|
||||
<span to={`/go/${encodeURIComponent(node?.id)}`} id="linkTitle">
|
||||
{node?.name}
|
||||
</linkTitle>
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue