use alertDialog within key mnanager panel

This commit is contained in:
brxken128 2023-01-24 16:22:48 +00:00
parent d8b6789cb7
commit 0ba0945662
No known key found for this signature in database
GPG key ID: 8B8D1AA6AE10A8FF

View file

@ -2,6 +2,7 @@ import { Eye, EyeSlash, Gear, Lock } from 'phosphor-react';
import { useState } from 'react';
import { useLibraryMutation, useLibraryQuery } from '@sd/client';
import { Button, ButtonLink, Input, Tabs } from '@sd/ui';
import { showAlertDialog } from '~/util/dialog';
import { DefaultProps } from '../primitive/types';
import { KeyList } from './KeyList';
import { KeyMounter } from './KeyMounter';
@ -13,7 +14,10 @@ export function KeyManager(props: KeyManagerProps) {
const isKeyManagerUnlocking = useLibraryQuery(['keys.isKeyManagerUnlocking']);
const setMasterPasswordMutation = useLibraryMutation('keys.unlockKeyManager', {
onError: () => {
alert('Incorrect information provided.');
showAlertDialog({
title: 'Unlock Error',
value: 'The information provided to the key manager was incorrect'
});
}
});
const unmountAll = useLibraryMutation('keys.unmountAll');