From 5afc840ea5722df006fb8d3932c401afba06f8a2 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Fri, 11 Nov 2016 17:04:08 -0800 Subject: [PATCH] More tweaks --- app/ui/components/dropdowns/SyncDropdown.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/ui/components/dropdowns/SyncDropdown.js b/app/ui/components/dropdowns/SyncDropdown.js index c8156c6f08..235e067da3 100644 --- a/app/ui/components/dropdowns/SyncDropdown.js +++ b/app/ui/components/dropdowns/SyncDropdown.js @@ -55,8 +55,7 @@ class SyncDropdown extends Component { async _reloadData () { // Get or create any related sync data const workspace = await models.workspace.getById(this.props.workspaceId); - const resource = await sync.getOrCreateResourceForDoc(workspace); - const resourceGroupId = resource.resourceGroupId; + const {resourceGroupId} = await sync.getOrCreateResourceForDoc(workspace); const config = await sync.getOrCreateConfig(resourceGroupId); // Analyze it @@ -66,7 +65,7 @@ class SyncDropdown extends Component { const syncPercent = all.length === 0 ? 100 : parseInt(numClean / all.length * 1000) / 10; const syncData = { - resource, + resourceGroupId, syncPercent, syncMode: config.syncMode, name: workspace.name, @@ -95,7 +94,7 @@ class SyncDropdown extends Component { render () { const {syncData, loading} = this.state; if (syncData && session.isLoggedIn()) { - const {resource, syncMode, syncPercent} = syncData; + const {resourceGroupId, syncMode, syncPercent} = syncData; const description = this._getSyncDescription(syncMode, syncPercent); return ( @@ -103,13 +102,11 @@ class SyncDropdown extends Component { {description} - this._handleToggleSyncMode(resource.resourceGroupId)} + this._handleToggleSyncMode(resourceGroupId)} stayOpenAfterClick={true}> - {syncMode === syncStorage.SYNC_MODE_OFF ? ( - - ) : ( - - )} + {syncMode === syncStorage.SYNC_MODE_OFF ? + : + } Sync Automatically @@ -117,7 +114,7 @@ class SyncDropdown extends Component { Share Workspace - this._handleSyncResourceGroupId(resource.resourceGroupId)} + this._handleSyncResourceGroupId(resourceGroupId)} disabled={syncPercent === 100} stayOpenAfterClick={true}> {loading ?