Skip to content

Conversation

@ahsanatzapier
Copy link
Collaborator

For an example of how to fill this template out, see this Pull Request.

Description

This PR introduces a custom hook, useEnsureListPath, that checks for the presence of a saved list path in localStorage. If the list path does not exist, the user receives a notification and is redirected to the home page. The goal is to improve user experience by ensuring users are properly routed when they attempt to access protected pages without selecting or creating a list first.

Acceptance Criteria

  • If there is no list path in localStorage, the user is redirected to the home page.
  • The user receives a notification that informs them why they are being redirected.

Type of Changes

  • Enhancement

Updates

Before

  • The list view loads on a black page with no feedback to the user when a listPath doesn't exist.

After

  • When a user tries to access a protected page without a list, they are gracefully notified and redirected to the home page.

Testing Steps / QA Criteria

  • Start the app and clear any localStorage entries related to the list path (tcl-shopping-list-path).
  • Navigate to List or Manage List view.
  • Observe notification informing you about the need to create/select a list.

@github-actions
Copy link

github-actions bot commented Sep 29, 2024

Visit the preview URL for this PR (updated for commit a032765):

https://tcl-75-smart-shopping-list--pr58-fix-listpath-check-rw1vd7m2.web.app

(expires Sun, 06 Oct 2024 05:26:18 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 1f1fd53c369e1fa31e15c310aa075b4e8f4f8dde

@ahsanatzapier ahsanatzapier merged commit 15c5e40 into main Sep 29, 2024
6 checks passed
@ahsanatzapier ahsanatzapier deleted the fix-listPath-check branch September 29, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant