Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
- fix when and how quickactions are fetched #2021
Browse files Browse the repository at this point in the history
  • Loading branch information
siemiatj committed Oct 23, 2018
1 parent a24d1b5 commit 454a8b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 1 addition & 3 deletions src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -787,9 +787,7 @@ class DocumentList extends Component {
);
}

const showQuickActions = Boolean(
!isModal || inBackground || selectionValid
);
const showQuickActions = true;

return (
<div
Expand Down
17 changes: 9 additions & 8 deletions src/components/app/QuickActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,25 @@ class QuickActions extends Component {
constructor(props) {
super(props);

this.state = initialState;
}

componentDidMount = () => {
this.mounted = true;

const {
fetchOnInit,
selected,
windowType,
viewId,
childView,
parentView,
} = props;
this.state = initialState;
} = this.props;

if (fetchOnInit) {
this.fetchActions(windowType, viewId, selected, childView, parentView);
}
}
};

componentWillUnmount = () => {
this.mounted = false;
Expand Down Expand Up @@ -86,10 +91,6 @@ class QuickActions extends Component {
return nextProps.shouldNotUpdate !== true;
}

componentDidMount = () => {
this.mounted = true;
}

componentDidUpdate = prevProps => {
const { inBackground, inModal } = this.props;

Expand Down Expand Up @@ -161,7 +162,7 @@ class QuickActions extends Component {
return;
}

if (windowType && viewId && selected && childView && parentView) {
if (windowType && viewId && childView && parentView) {
quickActionsRequest(windowType, viewId, selected, childView, parentView)
.then(response => {
this.setState({
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const getQueryString = query =>

if (Array.isArray(value) && value.length > 0) {
parameters[key] = value.join(',');
} else {
} else if (value) {
parameters[key] = value;
}

Expand Down

0 comments on commit 454a8b7

Please sign in to comment.