Removed useless loging

This commit is contained in:
2020-04-29 02:58:07 +03:00
parent 9ff4779720
commit 75344822ed
4 changed files with 13 additions and 23 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class Navbar extends React.Component<Props, State> {
logout = () => { logout = () => {
this.props.logout(); this.props.logout();
localStorage.removeItem('user'); localStorage.removeItem('user');
userLogout().then(console.log).catch(console.error); userLogout().then();
}; };
changeSize = () => { changeSize = () => {
-2
View File
@@ -69,8 +69,6 @@ class Novel extends React.Component<Props, State> {
const { match: { params: { novelId } } } = this.props; const { match: { params: { novelId } } } = this.props;
postNovelComment(novelId, text).then((comment: CommentType) => { postNovelComment(novelId, text).then((comment: CommentType) => {
const { comments } = this.state; const { comments } = this.state;
console.log(comment)
console.log(Object.assign({}, comments, { comment }));
this.setState({ comments: [comment, ...comments] }); this.setState({ comments: [comment, ...comments] });
}).catch(console.error); }).catch(console.error);
}; };
+11 -15
View File
@@ -12,20 +12,16 @@ type Props = {
mark?: number mark?: number
} }
const NovelItem = ({ id, original_name, localized_name, image, status, mark }: Props) => { const NovelItem = ({ id, original_name, localized_name, image, status, mark }: Props) => (
console.log(mark !== undefined && mark > 0 && <div>{mark}</div>) <Link to={`/novels/${id}`} className="NovelItem">
<div className='NovelItem__Image' style={{ backgroundImage: `url(${image || '/static/img/no-image.png'})` }}/>
return ( <div className="NovelItem__Title">
<Link to={`/novels/${id}`} className="NovelItem"> {localized_name || original_name}
<div className='NovelItem__Image' style={{ backgroundImage: `url(${image || '/static/img/no-image.png'})` }}/> </div>
<div className="NovelItem__Title"> {status && <div className="NovelItem__Status">
{localized_name || original_name} {TranslateStatus[status]} {mark !== undefined && mark > 0 && mark}
</div> </div>}
{status && <div className="NovelItem__Status"> </Link>
{TranslateStatus[status]} {mark !== undefined && mark > 0 && mark} );
</div>}
</Link>
);
}
export default NovelItem; export default NovelItem;
+1 -5
View File
@@ -27,17 +27,13 @@ class User extends React.Component<Props, State> {
const params = this.props.match.params; const params = this.props.match.params;
fetchUser(parseInt(params.userId)).then((user: UserType) => { fetchUser(parseInt(params.userId)).then((user: UserType) => {
console.log(user)
this.setState({ user }); this.setState({ user });
document.title = `${user.username} / Unmei`; document.title = `${user.username} / Unmei`;
fetchUserNovels(parseInt(params.userId)).then((novels: NovelType[]) => { fetchUserNovels(parseInt(params.userId)).then((novels: NovelType[]) => {
this.setState({ novels }); this.setState({ novels });
}).catch((err: ApiError) => console.error(err)); }).catch((err: ApiError) => console.error(err));
}).catch((err: ApiError) => { }).catch((err: ApiError) => this.setState({ errorCode: err.code }));
this.setState({ errorCode: err.code })
console.log(err)
});
} }
sendActivateLink = () => { sendActivateLink = () => {