# Follow an author

## Follow an author

Following an author lets you manage your relationship with another author's profile from the
Profile route. The author's username appears in the profile header beside the `Follow` or
`Unfollow` control.

| If you need to… | Go to |
|---|---|
| Open an author's profile | [View a profile](doc:view-a-profile) |
| Follow or unfollow the author | Follow [the procedure below](#follow-or-unfollow-the-author). |
| Change your own profile settings | [Update your settings](doc:update-your-settings) |

## Before you start

The Profile page must load a profile for an author other than the signed-in user. The page loads
the profile before it presents the profile content. The following state records whether you already
follow that author and determines whether `Follow` or `Unfollow` appears.

**Prerequisites**

- You know which author's profile to open.
- You are signed in before selecting `Follow`. The follow handler returns without sending the
  request when the user is not authenticated.
- The profile belongs to another user. Your own profile presents **Edit Profile Settings** instead
  of the `Follow` or `Unfollow` controls in the profile header.

When these conditions are met, open the author's profile.

## Open an author's profile

An author's profile is the Profile page identified by the author's username.

**Steps**

1. Follow [View a profile](doc:view-a-profile) to open the author's Profile page.

**Result:** The author's profile page is open, with the author's username beside the `Follow` or
`Unfollow` control in the profile header.

## Recognize the Follow or Unfollow controls

The `Follow` or `Unfollow` control appears in the profile header beside the author's username and
profile information. Use the label shown there to choose the action.

| The profile's following state is… | The control label is… |
|---|---|
| `false` | `Follow` |
| `true` | `Unfollow` |

Use the label shown in the profile header in the next procedure.

## Follow or unfollow the author

Use this procedure when the author's Profile page is open and you can identify whether `Follow` or
`Unfollow` appears in the profile header.

**Prerequisites**

- The author's profile is loaded.
- The profile belongs to another user.

**Steps**

1. Select **Follow** or **Unfollow** according to the profile state.

| If the profile state is… | Select… |
|---|---|
| `false` | **Follow** |
| `true` | **Unfollow** |

**Result:** After the request succeeds, the Profile page displays the refreshed profile data and
the profile's current following state.

## Choose the action for the current state

The profile state determines whether you follow an author, unfollow an author, or manage your own
profile settings.

**Prerequisites**

- The Profile page has loaded the profile username.

**Steps**

1. Choose the action that matches the profile you opened.

   | If you opened… | Select… |
   |---|---|
   | Another user's profile that you do not follow | **Follow** |
   | Another user's profile that you already follow | **Unfollow** |
   | Your own profile | **Edit Profile Settings** |

**Result:** The Profile page shows the action for the profile's current state. If the action does
not complete, use the guidance in the next section.

## When the action does not complete

The Profile page uses a loading message while the profile is being fetched and a separate message
when the profile cannot be loaded. If a follow or unfollow request fails, the profile stays as it
was and no error message appears.

| What you see | What to do |
|---|---|
| `Loading profile...` | Wait for the profile to finish loading. |
| `This profile could not be loaded. Please try again later.` | Try opening the author's Profile page again later. |
| The profile stays unchanged after selecting **Follow** or **Unfollow** | Select **Follow** or **Unfollow** again when the profile is available. |

## What to do next

After you finish the follow decision, continue from the author's Profile page. For changes to your
own profile, go to [Update your settings](doc:update-your-settings).
