Fix reconnecting from username icon

This commit is contained in:
varjolintu 2022-07-09 10:32:48 +03:00
parent a2321b2424
commit 129259b1ff

View file

@ -123,10 +123,14 @@ const iconClicked = async function(field, icon) {
return;
}
// Try to reconnect if KeePassXC is not currently connected
const connected = await sendMessage('is_connected');
if (!connected) {
kpxcUI.createNotification('error', tr('errorNotConnected'));
return;
const reconnectResponse = await sendMessage('reconnect');
if (!reconnectResponse.keePassXCAvailable) {
kpxcUI.createNotification('error', tr('errorNotConnected'));
return;
}
}
const databaseHash = await sendMessage('check_database_hash');