Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mug committed Oct 4, 2022
1 parent 049fce7 commit dab55ea
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/LastUpdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ export class LastUpdated extends React.Component {
}
}

static contextType = UserContext;

componentDidMount() {
console.log(this.props.user);
if (this.props.user != null) {
const { user, setUser } = this.context;

if (user != null) {
API.getFollowedManga(this.state.mlimit, this.state.moffset).then(res => {
this.setState({
mangas: res.data,
Expand All @@ -49,6 +52,8 @@ export class LastUpdated extends React.Component {
}

render() {
const { user, setUser } = this.context;

const page_switch = (value) => {
console.log("Set page ", value);
//TODO: Push history?
Expand All @@ -63,7 +68,7 @@ export class LastUpdated extends React.Component {
//TODO: Select mlimit
return (
<React.Fragment>
{this.props.user == null && display_alert("info" ,"m-2 widthfix", "Notice", [
{user == null && display_alert("info" ,"m-2 widthfix", "Notice", [
"Please ",
display_fa_icon("sign-in-alt"),
" ",
Expand Down

0 comments on commit dab55ea

Please sign in to comment.