{React, RegExpUtils} = require 'nylas-exports' PGPKeyStore = require './pgp-key-store' KeybaseSearch = require './keybase-search' KeyManager = require './key-manager' KeyAdder = require './key-adder' class PreferencesKeybase extends React.Component @displayName: 'PreferencesKeybase' constructor: (@props) -> @_keySaveQueue = {} {pubKeys, privKeys} = @_getStateFromStores() @state = pubKeys: pubKeys privKeys: privKeys componentDidMount: => @unlistenKeystore = PGPKeyStore.listen(@_onChange, @) componentWillUnmount: => @unlistenKeystore() _onChange: => @setState @_getStateFromStores() _getStateFromStores: -> pubKeys = PGPKeyStore.pubKeys() privKeys = PGPKeyStore.privKeys(timed: false) return {pubKeys, privKeys} render: => noKeysMessage =