mirror of https://github.com/keeweb/keeweb.git
returning one matching entry automatically
This commit is contained in:
parent
732c35625b
commit
18524ad9eb
|
@ -415,29 +415,32 @@ const ProtocolHandlers = {
|
||||||
const client = getClient(request);
|
const client = getClient(request);
|
||||||
|
|
||||||
const filter = new SelectEntryFilter({ url: payload.url }, appModel, files);
|
const filter = new SelectEntryFilter({ url: payload.url }, appModel, files);
|
||||||
|
filter.subdomains = false;
|
||||||
|
|
||||||
const entries = filter.getEntries();
|
const entries = filter.getEntries();
|
||||||
if (!entries.length) {
|
if (!entries.length) {
|
||||||
throw makeError(Errors.noMatches);
|
throw makeError(Errors.noMatches);
|
||||||
}
|
}
|
||||||
|
|
||||||
const topMessage = Locale.extensionSelectPasswordFor.replace(
|
let entry;
|
||||||
'{}',
|
|
||||||
getHumanReadableExtensionName(client)
|
|
||||||
);
|
|
||||||
const selectEntryView = new SelectEntryView({
|
|
||||||
filter,
|
|
||||||
topMessage
|
|
||||||
});
|
|
||||||
|
|
||||||
focusKeeWeb();
|
if (entries.length === 1 && client.permissions.askGet === 'multiple') {
|
||||||
|
entry = entries[0];
|
||||||
|
} else {
|
||||||
|
filter.subdomains = true;
|
||||||
|
const extName = getHumanReadableExtensionName(client);
|
||||||
|
const topMessage = Locale.extensionSelectPasswordFor.replace('{}', extName);
|
||||||
|
const selectEntryView = new SelectEntryView({ filter, topMessage });
|
||||||
|
|
||||||
const result = await selectEntryView.showAndGetResult();
|
focusKeeWeb();
|
||||||
if (!result?.entry) {
|
|
||||||
throw makeError(Errors.userRejected);
|
const result = await selectEntryView.showAndGetResult();
|
||||||
|
entry = result?.entry;
|
||||||
|
if (!entry) {
|
||||||
|
throw makeError(Errors.userRejected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const entry = result.entry;
|
|
||||||
|
|
||||||
client.stats.passwordsRead++;
|
client.stats.passwordsRead++;
|
||||||
|
|
||||||
return encryptResponse(request, {
|
return encryptResponse(request, {
|
||||||
|
|
Loading…
Reference in New Issue