From 7cc1fe55c047576e9542bdaa2e8f8b450b41573c Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 6 Dec 2015 20:54:23 -0700 Subject: [PATCH] * Better handling of TOONODE (existing user already logged in) --- core/system_menu_method.js | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 86723dcc..54528c80 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -22,26 +22,8 @@ function login(callingMenu, formData, extraArgs) { userLogin(callingMenu.client, formData.value.username, formData.value.password, function authResult(err) { if(err) { // login failure - if(err.existingConn) { - client.term.rawWrite(ansi.resetScreen()); - - var artOpts = { - client : client, - font : _.has(callingMenu, 'menuConfig.config.tooNode.font') ? callingMenu.menuConfig.config.tooNode.font : null, - name : _.has(callingMenu, 'menuConfig.config.tooNode.art') ? callingMenu.menuConfig.config.tooNode.art : 'TOONODE', - }; - - theme.displayThemeArt(artOpts, function artDisplayed(err) { - if(err) { - client.term.write('\nA user by that name is already logged in.\n'); - } - - setTimeout(function timeout() { - callingMenu.prevMenu(); - }, 2000); - }); - - return; + if(err.existingConn && _.has(callingMenu, 'menuConfig.config.tooNodeMenu')) { + callingMenu.gotoMenu(callingMenu.menuConfig.config.tooNodeMenu); } else { // Other error callingMenu.prevMenu();