import _ from 'underscore'; import {AccountStore, FolderSyncProgressStore, React} from 'nylas-exports'; export default class InitialSyncActivity extends React.Component { static displayName = 'InitialSyncActivity'; constructor(props) { super(props); this.state = { syncState: FolderSyncProgressStore.getSyncState(), } this.mounted = false; } componentDidMount() { this.mounted = true; this.unsub = FolderSyncProgressStore.listen(this.onDataChanged) } componentWillUnmount() { this.unsub(); this.mounted = false; } onDataChanged = () => { this.setState({syncState: FolderSyncProgressStore.getSyncState()}); } renderFolderProgress(folderPath, progress) { let status = 'busy'; let progressLabel = `In Progress (${Math.round(progress * 100)}%)`; if (progress === 1) { status = 'complete'; progressLabel = ''; } return (