Commit f0493f9f authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃 Committed by richard
Browse files

fixup! Bug 40597: Implement TorSettings module

Bug 41907: Change state after the process becomes ready only when we
are in the initial state.
parent 1a8be7b1
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -874,6 +874,18 @@ const TorConnect = (() => {
      switch (topic) {
        /* We need to wait until TorSettings have been loaded and applied before we can Quickstart */
        case TorSettingsTopics.Ready: {
          // tor-browser#41907: This is only a workaround to avoid users being
          // bounced back to the initial panel without any explanation.
          // Longer term we should disable the clickable elements, or find a UX
          // to prevent this from happening (e.g., allow buttons to be clicked,
          // but show an intermediate starting state, or a message that tor is
          // starting while the butons are disabled, etc...).
          if (this.state !== TorConnectState.Initial) {
            console.warn(
              "TorConnect: Seen the torsettings:ready after the state has already changed, ignoring the notification."
            );
            break;
          }
          if (this.shouldQuickStart) {
            // Quickstart
            this._changeState(TorConnectState.Bootstrapping);