From 701a13efaf48681d3088d51c404ee5ac51c0c75a Mon Sep 17 00:00:00 2001 From: tarafanlin <35607644+tarafanlin@users.noreply.github.com> Date: Thu, 3 Dec 2020 17:31:18 -0800 Subject: [PATCH] default show action bar during loading --- components/core/DataView.js | 2 +- components/core/SlateLayout.js | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/components/core/DataView.js b/components/core/DataView.js index 34b15a5d..ef408530 100644 --- a/components/core/DataView.js +++ b/components/core/DataView.js @@ -362,12 +362,12 @@ export default class DataView extends React.Component { let item = this.props.viewer.library[0].children[index]; return item.id; }); - this.setState({ checked: {} }); } await this._handleLoading({ cids }); await UserBehaviors.deleteFiles(cids, ids); this._handleLoading({ cids }); + await this.setState({ checked: {} }); }; _handleSelect = (index) => { diff --git a/components/core/SlateLayout.js b/components/core/SlateLayout.js index 5b5c761c..1c938132 100644 --- a/components/core/SlateLayout.js +++ b/components/core/SlateLayout.js @@ -235,6 +235,8 @@ const STYLES_ACTION_BAR_CONTAINER = css` display: flex; justify-content: center; z-index: ${Constants.zindex.header}; + left: 10vw; + width: 80vw; @media (max-width: ${Constants.sizes.mobile}px) { display: none; @@ -1053,7 +1055,6 @@ export class SlateLayout extends React.Component { for (let index of Object.keys(this.state.checked)) { ids.push(this.state.items[index].id); } - this.setState({ checked: {} }); } let cids = []; for (let file of this.props.viewer.library[0].children) { @@ -1065,6 +1066,7 @@ export class SlateLayout extends React.Component { await this._handleLoading({ cids }); await UserBehaviors.deleteFiles(cids, ids); this._handleLoading({ cids }); + await this.setState({ checked: {} }); }; _handleLoading = ({ cids }) => { @@ -1755,12 +1757,6 @@ export class SlateLayout extends React.Component { transparent style={{ marginLeft: 8, color: Constants.system.white }} onClick={this._handleRemoveFromSlate} - loading={ - this.state.loading && - Object.values(this.state.loading).some((elem) => { - return !!elem; - }) - } > Remove