From 9b0daa26dbaebb70723d309f0bc4fb62bd3a0043 Mon Sep 17 00:00:00 2001
From: nickdu <nick@nickdu.com>
Date: Thu, 10 May 2012 15:25:03 +1000
Subject: Fix when browser starts up proxy is not set correctly issue

---
 src/chrome/content/proxy.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

(limited to 'src/chrome')

diff --git a/src/chrome/content/proxy.js b/src/chrome/content/proxy.js
index 8c94d0f..85664dc 100644
--- a/src/chrome/content/proxy.js
+++ b/src/chrome/content/proxy.js
@@ -65,9 +65,11 @@ function mproxy_initProxy(event){
 		//Populate Proxy List
 		mproxy_populateList();
 		
-		//Set Last Proxy Selected
-		if(gSwitchP_List != null)
-			gSwitchP_LastItem = gSwitchP_List.selectedItem;
+	    	//Set Last Proxy Selected
+	    	if (gSwitchP_List != null) {
+	        	gSwitchP_List.selectedItem.value = gSwitchP_Prefs.getCharPref("mproxy.proxy.current");
+	        	gSwitchP_LastItem = gSwitchP_List.selectedItem;
+	    	}
 		
 		//Add Preferences Listener
 		var oProxyObserver = {
@@ -96,7 +98,7 @@ oPrefBranch.addObserver("mproxy.proxy.rdf.lastupdate", oProxyObserver, false);
 		
 		// Start Anon Rotation
 		//setTimeout("mproxy_anon_nextProxy()", 1000);
-		
+		mproxy_setProxy(true);
 		gSwitchP_Loaded = true;
 	}
 }
-- 
cgit v1.2.3