Bug 1524665 - update sync now item when syncing, r=vbudhram
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 18 Mar 2019 15:44:28 +0000
changeset 506571 dc47fddd9a63007e027366366652723268e53cbe
parent 506570 465af3e561275ab93db9b63cefe1a91ccb2250af
child 506572 93677154ad256f4b7e04c67ba2c28bfe27ad7565
push id138
push usermtabara@mozilla.com
push dateWed, 20 Mar 2019 18:12:49 +0000
reviewersvbudhram
bugs1524665
milestone68.0a1
Bug 1524665 - update sync now item when syncing, r=vbudhram Differential Revision: https://phabricator.services.mozilla.com//D23695
browser/base/content/browser-sync.js
browser/components/customizableui/content/panelUI.inc.xul
--- a/browser/base/content/browser-sync.js
+++ b/browser/base/content/browser-sync.js
@@ -752,28 +752,30 @@ var gSync = {
 
   // Functions called by observers
   onActivityStart() {
     clearTimeout(this._syncAnimationTimer);
     this._syncStartTime = Date.now();
 
     let label = this.syncStrings.GetStringFromName("syncingtabs.label");
     let remotetabsSyncNowEl = document.getElementById("PanelUI-remotetabs-syncnow");
+    let fxaMenuSyncNowEl = document.getElementById("PanelUI-fxa-menu-syncnow-button");
     let syncElements = [
       document.getElementById("appMenu-fxa-icon"),
       remotetabsSyncNowEl,
-      document.getElementById("PanelUI-fxa-menu-syncnow-button"),
+      fxaMenuSyncNowEl,
     ];
 
     syncElements.forEach((el) => {
       el.setAttribute("syncstatus", "active");
       el.setAttribute("disabled", "true");
     });
 
     remotetabsSyncNowEl.setAttribute("label", label);
+    fxaMenuSyncNowEl.setAttribute("label", fxaMenuSyncNowEl.getAttribute("syncinglabel"));
   },
 
   _onActivityStop() {
     if (!gBrowser)
       return;
 
     let label = this.syncStrings.GetStringFromName("syncnow.label");
     let syncElements = [
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -757,16 +757,17 @@
                          oncommand="SidebarUI.toggle('viewTabsSidebar');"/>
           <toolbarseparator/>
           <toolbarbutton class="subviewbutton" label="&fxa.menu.connectAnotherDevice.label;" oncommand="gSync.openConnectAnotherDevice('fxa_discoverability_native');"/>
           <toolbarbutton class="subviewbutton" label="&fxa.menu.manageAccount.label;" oncommand="gSync.openFxAManagePage('fxa_discoverability_native');"/>
           <toolbarbutton class="subviewbutton" label="&fxa.menu.syncSettings.label;" oncommand="gSync.openPrefs('fxa_discoverability_native');"/>
           <toolbarseparator/>
           <toolbarbutton id="PanelUI-fxa-menu-syncnow-button"
                          label="&syncSyncNowItem.label;"
+                         syncinglabel="&syncSyncNowItemSyncing.label;"
                          class="subviewbutton subviewbutton-iconic"
                          oncommand="gSync.doSync();"
                          closemenu="none"/>
         </vbox>
       </vbox>
     </panelview>
     <!-- This panelview is used to contain the dynamically created buttons for send tab to devices -->
     <panelview id="PanelUI-sendTabToDevice" flex="1" class="PanelUI-subView">