mirror of
https://github.com/keepassxreboot/keepassxc-browser.git
synced 2026-03-11 08:54:43 +00:00
Add some extra checks when removing a connection
This commit is contained in:
parent
a776a36dc5
commit
1a218573e7
2 changed files with 8 additions and 3 deletions
|
|
@ -15,7 +15,8 @@ kpxcEvent.onMessage = async function(request, sender) {
|
|||
|
||||
kpxcEvent.showStatus = async function(tab, configured, internalPoll) {
|
||||
let keyId = null;
|
||||
if (configured && keepass.databaseHash !== '') {
|
||||
if (configured && keepass.databaseHash !== ''
|
||||
&& Object.hasOwn(keepass.databaseHash, keepass.databaseHash)) {
|
||||
keyId = keepass.keyRing[keepass.databaseHash].id;
|
||||
}
|
||||
|
||||
|
|
@ -91,7 +92,7 @@ kpxcEvent.onGetStatus = async function(tab, args = []) {
|
|||
kpxcEvent.onReconnect = async function(tab) {
|
||||
const configured = await keepass.reconnect(tab);
|
||||
if (configured) {
|
||||
browser.tabs.sendMessage(tab.id, {
|
||||
browser.tabs.sendMessage(tab?.id, {
|
||||
action: 'redetect_fields'
|
||||
}).catch((err) => {
|
||||
logError(err);
|
||||
|
|
|
|||
|
|
@ -370,7 +370,11 @@ options.initConnectedDatabases = function() {
|
|||
const closestTr = this.closest('tr');
|
||||
$('#dialogDeleteConnectedDatabase').setAttribute('hash', closestTr.getAttribute('hash'));
|
||||
$('#dialogDeleteConnectedDatabase').setAttribute('tr-id', closestTr.getAttribute('id'));
|
||||
$('#dialogDeleteConnectedDatabase .modal-body strong').textContent = closestTr.children[0].textContent;
|
||||
|
||||
const identifier = $('#dialogDeleteConnectedDatabase .modal-body strong');
|
||||
if (identifier) {
|
||||
identifier.textContent = closestTr.children[0].textContent;
|
||||
}
|
||||
|
||||
dialogDeleteConnectedDatabaseModal.show();
|
||||
$('#dialogDeleteConnectedDatabase').addEventListener('shown.bs.modal', function(modalEvent) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue