diff --git a/public/locales/en.json b/public/locales/en.json index 753be54..9bcd195 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -1093,6 +1093,13 @@ "errorPasswordIncorrect": "Incorrect password.", "errorUnknown": "An unknown error occurred. See console for details.", - "buttonSubmit": "Begin migration" + "buttonForgotPassword": "Forgot password", + "buttonSubmit": "Begin migration", + + "forgotPassword": { + "modalTitle": "Skip v1 migration", + "modalContent": "If you forgot your master password for KristWeb v1, then you will not be able to migrate your wallets. You will never be asked again. Are you sure you want to skip migration?", + "buttonSkip": "Skip" + } } } diff --git a/src/global/legacy/LegacyMigrationModal.tsx b/src/global/legacy/LegacyMigrationModal.tsx index da53b63..ec29149 100644 --- a/src/global/legacy/LegacyMigrationModal.tsx +++ b/src/global/legacy/LegacyMigrationModal.tsx @@ -3,6 +3,7 @@ // Full details: https://github.com/tmpim/KristWeb2/blob/master/LICENSE.txt import { useState } from "react"; import { Modal, Button } from "antd"; +import { ExclamationCircleOutlined } from "@ant-design/icons"; import { useTFns } from "@utils/i18n"; @@ -14,6 +15,9 @@ import { BackupResultsSummary } from "@pages/backup/BackupResultsSummary"; import { BackupResultsTree } from "@pages/backup/BackupResultsTree"; +import Debug from "debug"; +const debug = Debug("kristweb:legacy-migration-modal"); + interface Props { backup: BackupKristWebV1; setVisible: (visible: boolean) => void; @@ -38,6 +42,30 @@ setVisible(false); } + function openForgotPasswordModal() { + Modal.confirm({ + title: tStr("forgotPassword.modalTitle"), + icon: , + + content: tStr("forgotPassword.modalContent"), + + cancelText: t("dialog.cancel"), + + okText: tStr("forgotPassword.buttonSkip"), + okType: "danger", + onOk() { + debug("skipping v1 legacy migration"); + + // Mark the migration as completed, so the modal won't appear again. + // The data will be deleted after 7 days. + localStorage.setItem("migrated", "2"); + localStorage.setItem("legacyMigratedTime", new Date().toISOString()); + + closeModal(); + } + }); + } + return + {/* Forgot password button */} + + + {/* Submit button */} - )} + } > {/* Show the results screen, progress bar, or backup form */} {results