default show action bar during loading

This commit is contained in:
tarafanlin 2020-12-03 17:31:18 -08:00
parent c0ecc7afb0
commit 701a13efaf
2 changed files with 4 additions and 8 deletions

View File

@ -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) => {

View File

@ -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
</ButtonWarning>