From 6996c5eb4b07513e7d1c3b14debf84d793199677 Mon Sep 17 00:00:00 2001 From: Andrew Kaiser Date: Sun, 16 Sep 2018 16:36:23 -0400 Subject: [PATCH] close #1, filter selectable accounts to login accounts only --- package.json | 2 +- src/index.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0a4c043..97d1fc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitwarden-dmenu", - "version": "1.1.1", + "version": "1.1.2", "description": "", "keywords": [ "bitwarden", diff --git a/src/index.js b/src/index.js index 9231de4..fcdf506 100644 --- a/src/index.js +++ b/src/index.js @@ -55,7 +55,10 @@ const getAccounts = ({ session }) => { // choose one account with dmenu const chooseAccount = async ({ list }) => { - const accountNames = list.map(a => `${a.name}: ${a.login.username}`) + const LOGIN_TYPE = 1 + const accountNames = list + .filter(a => a.type === LOGIN_TYPE) + .map(a => `${a.name}: ${a.login.username}`) const selected = await dmenuRun(accountNames.join('\n')) const index = accountNames.indexOf(selected) const selectedAccount = list[index]