Skip to content

Commit

Permalink
chore: add confirmation on logout link
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jan 7, 2024
1 parent 16bf51c commit 6fee731
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,18 @@ export function Navbar({ onOpenCart }: NavbarProps) {
<li>
<Link
to="/"
onClick={() => {
onClick={(e) => {
if (
!confirm(
"Are you sure you wish to log out? your wallet will be lost."
)
) {
e.preventDefault();
return;
}
window.localStorage.removeItem(localStorageKeys.nwcUrl);
}}
className="text-error"
>
<PopiconsLogoutDuotone className="w-4 h-4" /> Log out
</Link>
Expand Down

0 comments on commit 6fee731

Please sign in to comment.