diff --git a/kc-app/src/KeymasterUI.js b/kc-app/src/KeymasterUI.js
index cab419b5..299ecc86 100644
--- a/kc-app/src/KeymasterUI.js
+++ b/kc-app/src/KeymasterUI.js
@@ -48,6 +48,7 @@ function KeymasterUI({ keymaster, title }) {
const [mnemonicString, setMnemonicString] = useState('');
const [walletString, setWalletString] = useState('');
const [manifest, setManifest] = useState(null);
+ const [checkingWallet, setCheckingWallet] = useState(false);
useEffect(() => {
refreshAll();
@@ -657,6 +658,25 @@ function KeymasterUI({ keymaster, title }) {
}
}
+ async function checkWallet() {
+ setCheckingWallet(true);
+ try {
+ const { checked, invalid, deleted } = await keymaster.checkWallet();
+
+ if (invalid == 0 && deleted == 0) {
+ window.alert(`${checked} DIDs checked, no problems found`);
+ }
+ else if (window.confirm(`${checked} DIDs checked\n${invalid} invalid DIDs found\n${deleted} deleted DIDs found\n\nFix wallet?`)) {
+ const { idsRemoved, ownedRemoved, heldRemoved } = await keymaster.fixWallet();
+ window.alert(`${idsRemoved} IDs removed\n${ownedRemoved} owned DIDs removed\n${heldRemoved} held DIDs removed`);
+ }
+
+ } catch (error) {
+ window.alert(error);
+ }
+ setCheckingWallet(false);
+ }
+
async function showWallet() {
try {
const wallet = await keymaster.loadWallet();
@@ -1420,6 +1440,11 @@ function KeymasterUI({ keymaster, title }) {
Recover...
+
{mnemonicString}-
{mnemonicString}+