mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-07 11:20:47 +03:00
Hide credentials with the issuer "_hidden:".
This commit is contained in:
parent
dd2953b192
commit
cdfc77e0f3
@ -104,10 +104,10 @@ def show(ctx, query, slot1, slot2, timestamp):
|
||||
if creds is None:
|
||||
ctx.fail('No YubiKey found!')
|
||||
|
||||
matched = []
|
||||
if query:
|
||||
query = ' '.join(query)
|
||||
# Filter based on query. If exact match, show only that result.
|
||||
matched = []
|
||||
for cred, code in creds:
|
||||
if cred.name == query:
|
||||
matched = [(cred, code)]
|
||||
@ -127,6 +127,9 @@ def show(ctx, query, slot1, slot2, timestamp):
|
||||
else:
|
||||
creds = matched
|
||||
|
||||
if not query or len(matched) > 1: # Unless exact match, filter out hidden.
|
||||
creds = [c for c in creds if not c[0].name.startswith('_hidden:')]
|
||||
|
||||
print_creds(creds)
|
||||
|
||||
|
||||
|
@ -251,7 +251,8 @@ class CodesWidget(QtGui.QWidget):
|
||||
|
||||
def refresh(self):
|
||||
self._scroll_area.takeWidget().deleteLater()
|
||||
creds = self._controller.credentials
|
||||
creds = [c for c in self._controller.credentials
|
||||
if not c.cred.name.startswith('_hidden:')]
|
||||
self._scroll_area.setWidget(
|
||||
CodesList(self._controller.timer, creds or [], self.refresh_timer))
|
||||
w = self._scroll_area.widget().minimumSizeHint().width()
|
||||
|
Loading…
Reference in New Issue
Block a user