Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable passkey rename/delete button while not unlocked #200

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/pages/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ const WebauthnCredentialItem = ({
className={` ${!onDelete || unlocked ? "bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-700" : "bg-blue-600 hover:bg-blue-700 bg-gray-300 hover:bg-gray-300 cursor-not-allowed"} flex flex-row flex-nowrap items-center text-white font-medium rounded-lg text-sm px-4 py-2 text-center`}
type="button"
onClick={() => setEditing(true)}
disabled={!unlocked}
title={!unlocked ? t("pageSettings.passkeyItem.renameButtonTitleLocked") : ""}
aria-label={t('pageSettings.passkeyItem.renameAriaLabel', { passkeyLabel: currentLabel })}
>
Expand All @@ -517,6 +518,7 @@ const WebauthnCredentialItem = ({
className={` ${unlocked ? "bg-red-600 hover:bg-red-700 hover:text-white text-white" : "bg-gray-300 text-red-400 cursor-not-allowed hover:bg-gray-300"} text-sm font-medium rounded-lg text-sm px-5 py-2.5 text-center ml-2 px-4 py-2`}
type="button"
onClick={openDeleteConfirmation}
disabled={!unlocked}
aria-label={t('pageSettings.passkeyItem.deleteAriaLabel', { passkeyLabel: currentLabel })}
title={!unlocked ? t("pageSettings.passkeyItem.deleteButtonTitleLocked") : ""}

Expand Down
Loading