Skip to content

Article Page button always says that you already upvoted #9

Open
@eggonzal

Description

@eggonzal

Issue Overview

The uid is never sent from the useEffect in the ArticlePage since it loads before having the user being set.

Describe your environment

I have the same code as the one provided in branch 06_01b, with same setup as shown in the videos.

Steps to Reproduce

  1. Log in with a new user
  2. Open a page article
  3. The button to upvote will say that you already upvoted

Expected Behavior

The button should say Upvote. More technically the user data should be passed to the backend when loading the page.

Current Behavior

The button always says that you already upvoted, and the headers sent to the backend are always null. This is due to the logic of loading only when the isLoading variable is true, which means that the user variable hasn't been set.

Possible Solution

Not sure what is the proper solution but maybe loading the page once the user has been set.

Screenshots / Video

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions