From 4bd0c7c7c165c8faae8155f6b3226eb51b044390 Mon Sep 17 00:00:00 2001 From: hamza zia Date: Sat, 22 Jun 2013 21:37:14 +0100 Subject: [PATCH] tweaked getting the configuration from the cookie --- js/services/rpc/rpc.js | 4 +++- js/services/utils.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/services/rpc/rpc.js b/js/services/rpc/rpc.js index 5c99698..3c6142b 100644 --- a/js/services/rpc/rpc.js +++ b/js/services/rpc/rpc.js @@ -25,7 +25,9 @@ function(syscall, time, alerts, utils, rootScope, uri) { } var cookieConf = utils.getCookie('aria2conf'); - if (cookieConf) configurations.unshift(cookieConf); + + // try at the end, so that it is not overwridden in case it doesnt work + if (cookieConf) configurations.push(cookieConf); // update is implemented such that // only one syscall at max is ongoing diff --git a/js/services/utils.js b/js/services/utils.js index dcb49d0..a11827a 100644 --- a/js/services/utils.js +++ b/js/services/utils.js @@ -18,6 +18,8 @@ angular.module('webui.services.utils', []) return JSON.parse(unescape(cvalue)); } } + + return null; }, getFileName: function(path) { var seed = path.split(/[/\\]/);