Skip to content

Commit

Permalink
fix(error-overlay): hide "Learn more" when up-to-date (#46488)
Browse files Browse the repository at this point in the history
When the installed `latest` or `canary` of `next` matches the last
published version, we should hide the link that points to the error
message/explanation.

[Slack
thread](https://vercel.slack.com/archives/C04CAN8CGCE/p1677370692392969)

Fixes NEXT-672

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
balazsorban44 and ijjk committed Feb 28, 2023
1 parent 3609bdb commit 767e921
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,15 @@ export function VersionStalenessInfo(props: VersionInfo) {
>
{text}
</small>{' '}
<a
target="_blank"
rel="noopener noreferrer"
href="https://nextjs.org/docs/messages/version-staleness"
>
(learn more)
</a>
{staleness === 'fresh' || staleness === 'unknown' ? null : (
<a
target="_blank"
rel="noopener noreferrer"
href="https://nextjs.org/docs/messages/version-staleness"
>
(learn more)
</a>
)}
</small>
)
}

0 comments on commit 767e921

Please sign in to comment.