From 1754edd2efb87434606db30759d63ebf7f1eb53e Mon Sep 17 00:00:00 2001
From: "sspitzer%netscape.com" <sspitzer%netscape.com>
Date: Thu, 14 Sep 2000 20:19:17 +0000
Subject: [PATCH] fix for bug #51546.  work around for the bug that the
 onselect handler gets called twice.  this was causing the frame src to be set
 twice which was interrupting the file loading from the JAR. 
 r=alecf,putterman

---
 .../prefs/resources/content/AccountManager.js    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/mailnews/base/prefs/resources/content/AccountManager.js b/mailnews/base/prefs/resources/content/AccountManager.js
index 9bbd5c7912b..3627ec4f195 100644
--- a/mailnews/base/prefs/resources/content/AccountManager.js
+++ b/mailnews/base/prefs/resources/content/AccountManager.js
@@ -358,12 +358,28 @@ function setEnabled(control, enabled)
     control.setAttribute("disabled", true);
 }
 
+// this is a workaround for bug #51546
+// the on click handler is getting called twice
+var bug51546CurrentPage = null;
+var bug51546CurrentServerId = null;
+
 //
 // called when someone clicks on an account
 // figure out context by what they clicked on
 //
 function onAccountClick(tree) {
+  //dump("onAccountClick()\n");
+
   var result = getServerIdAndPageIdFromTree(tree);
+
+  //dump("sputter:"+bug51546CurrentPage+","+bug51546CurrentServerId+":"+result.pageId+","+result.serverId+"\n");
+  if ((bug51546CurrentPage == result.pageId) && (bug51546CurrentServerId == result.serverId)) {
+	//dump("workaround for #51546\n");
+	return;
+  }
+  
+  bug51546CurrentPage = result.pageId;
+  bug51546CurrentServerId = result.serverId;
   
   if (result) {
 	  showPage(result.serverId, result.pageId);