(function() {
  var PublicAddressPrompt = require('../components/public_address_prompt.js.jsx');
  var xhr = require('../xhr');
  var Dispatcher = require('../dispatcher');
  var Store = require('../stores/store');
  var _selected;

  var _store = Object.create(Store);

  var _dropdownStore = _.extend(_store, {
    showPublicAddressModal: function(data) {
      if (!data) {
        return;
      }

      var path = data.path;
      var preference = data.preference;
      var redirectTo = data.redirectTo;

      React.renderComponent(PublicAddressPrompt({
        path: path,
        redirectTo: redirectTo
      }), document.getElementById('public-address-prompt'));
    },

    updateSelected: function(data) {
      if (!data) {
        return;
      }

      var path = data.path;
      var preference = data.preference;
      var redirectTo = data.redirectTo;
      var publicAddress = data.publicAddress;

      window.xhr.post(path, { public_address: publicAddress }, function() {
        if (redirectTo) {
          app.redirectTo(redirectTo)
        }
      });

      _selected = preference;
    },

    getSelected: function() {
      return _selected;
    },

    setSelected: function(preference) {
      _selected = preference;
    },

    removeSelected: function() {
      _selected = undefined;
    }
  });

  _store.dispatchIndex = Dispatcher.register(function(payload) {
    var action = payload.action;
    var data = payload.data;

    if (!_store[action]) {
      return;
    }

    _store[action] && _store[action](data);
    _store.emitChange();
  });

  if (typeof module !== 'undefined') {
    module.exports = _dropdownStore;
  }

  window.NotificationPreferencesDropdownStore = _dropdownStore;
})();

@@ -11,91 +11,8 @@
 ) %7B%0A
-  var PublicAddressPrompt = require('../components/public_address_prompt.js.jsx');%0A
   va
@@ -227,376 +227,8 @@
 , %7B%0A
-    showPublicAddressModal: function(data) %7B%0A      if (!data) %7B%0A        return;%0A      %7D%0A%0A      var path = data.path;%0A      var preference = data.preference;%0A      var redirectTo = data.redirectTo;%0A%0A      React.renderComponent(PublicAddressPrompt(%7B%0A        path: path,%0A        redirectTo: redirectTo%0A      %7D), document.getElementById('public-address-prompt'));%0A    %7D,%0A%0A
     

Remove public address modal