     if FactlinkApp.signedIn()
       callback()
     else
-      opened = !@state.opened
-      @setState opened: opened
-
-      if opened
-        @_callback = callback
+      if @state.opened
+        @setState opened: false, callback: null
+      else
+        @setState opened: true, callback: callback
         FactlinkApp.vent.trigger 'ReactSigninPopover:opened', this
 
   render: ->

window.ReactSigninPopover = React.createClass
  getInitialState: ->
    opened: false

  componentDidMount: ->
    window.currentUser.on 'change:username', @_onSignedInChange, @

  _onOtherPopoverOpened: (popover) ->
    return if popover == this

    @setState opened: false, callback: null

  _onSignedInChange: ->
    if FactlinkApp.signedIn() && @state.opened
      @state.callback()
      @setState opened: false, callback: null

    @forceUpdate()

