feature/search
Kelvin Schoofs 6 years ago
parent 19fa5e7fc0
commit b79e4784e1

@ -63,7 +63,7 @@ export async function getSession(name?: string, host?: string, username?: string
}
if (!host) return null;
host = host.toLowerCase();
const hosts = sessions.filter(s => s.hostname.toLowerCase() === host);
const hosts = sessions.filter(s => s.hostname && s.hostname.toLowerCase() === host);
if (!username) return hosts[0] || null;
username = username.toLowerCase();
return hosts.find(s => !s.username || s.username.toLowerCase() === username) || null;

Loading…
Cancel
Save