From e9f5d257f1b835b18967d446183d84273df490d5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Wed, 30 Sep 2015 03:42:23 -0400 Subject: [PATCH] refactor(konsole) create spawn: on auth always -> on auth, only when auth enabled --- lib/client/konsole.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/client/konsole.js b/lib/client/konsole.js index 0fdf8f73..d74c45fa 100644 --- a/lib/client/konsole.js +++ b/lib/client/konsole.js @@ -51,16 +51,17 @@ var prefix = getPrefix(); Console(Element, prefix, function(spawn) { - spawn.on('auth', function() { - Dialog.alert(TITLE, 'Wrong credentials!'); - }); - DOM.Files.get('config', function(error, config) { if (error) return Dialog.alert(TITLE, error); - if (config.auth) + if (config.auth) { spawn.emit('auth', config.username, config.password); + + spawn.on('auth', function() { + Dialog.alert(TITLE, 'Wrong credentials!'); + }); + } }); Util.exec(callback);