fix(bio-links): surface error toasts on analytics fetch, clipboard copy, and SVG QR export failures

Open Beginner friendly
#36 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Domain
frontend

Research direction

Start with fetchAnalytics in apps/web/components/bio-links/BioAnalyticsView.tsx, then inspect handleCopy and handleDownloadSvg in apps/web/components/bio-links/ShareModal.tsx. Check how nearby bio-links components display errors and follow the existing toast pattern. Done when failed analytics requests, clipboard copies, and SVG exports each show a user-visible error.

Written by the indexing model from the issue text.

Description

bug good first issue ui web
Problem Description
  1. BioAnalyticsView.tsx (apps/web/components/bio-links/BioAnalyticsView.tsx):
    fetchAnalytics only calls setData(json) inside if (res.ok) and only logs console.error(...) in the catch block. On !res.ok or network failure, no toast.error(...) or visible error state is shown to the user.

  2. ShareModal.tsx (apps/web/components/bio-links/ShareModal.tsx):

    • handleCopy swallows clipboard errors in an empty catch { // fallback } block with no user feedback.
    • handleDownloadSvg only calls console.error('Failed to export SVG QR code:', err) on failure without notifying the user via toast.error(...).

Expected Behavior
  1. BioAnalyticsView.tsx throws on !res.ok and shows a toast.error(...) (and/or an error state) when analytics fail to load.
  2. ShareModal.tsx shows a toast.error(...) when copying the public URL or exporting the SVG QR code fails.

Where to Look
  • apps/web/components/bio-links/BioAnalyticsView.tsx (fetchAnalytics)
  • apps/web/components/bio-links/ShareModal.tsx (handleCopy, handleDownloadSvg)

Solution / Implementation Guide
  1. In BioAnalyticsView.tsx (fetchAnalytics):
    • If !res.ok, throw an error (safely parsing error JSON with .catch(() => ({}))).
    • In catch, call toast.error('Failed to load bio-links analytics') (or set an error state to render a retry message).
  2. In ShareModal.tsx:
    • Import toast (matching the rest of apps/web/components/bio-links/).
    • Call toast.error(...) in the catch blocks of handleCopy and handleDownloadSvg.
Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
6m
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sumamakhan761/tryinstance

All issues in sumamakhan761/tryinstance

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.