Skip to content
Snippets Groups Projects
Commit 5321f3f2 authored by Glenn Fischer's avatar Glenn Fischer
Browse files

#2404: fixes disabling of the moveToBottom button

parent 53089ab3
Branches
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@ export class WindowViewer extends Component {
setWindowHeight,
size,
view,
windowId,
} = this.props;
if (prevProps.view !== view
......@@ -73,9 +74,10 @@ export class WindowViewer extends Component {
});
});
}
// only accept changes of at least 1 pixel, to limit the re-rendering
if (Math.abs(height - size.height) > 1) {
setWindowHeight(window.id, size.height);
if (!height || Math.abs(height - size.height) > 1) {
setWindowHeight(windowId, size.height);
}
}
......
......@@ -7,7 +7,6 @@ import { withPlugins } from '../extend/withPlugins';
import * as actions from '../state/actions';
import {
getCompanionWindow,
getCompanionWindowsForPosition,
getWindow,
} from '../state/selectors';
import { CompanionWindow } from '../components/CompanionWindow';
......@@ -20,7 +19,8 @@ import { CompanionWindow } from '../components/CompanionWindow';
const mapStateToProps = (state, { id, windowId }) => {
const window = getWindow(state, { windowId });
const companionWindow = getCompanionWindow(state, { companionWindowId: id });
const showMoveToBottom = !window.height || window.height > 300 || companionWindow.position !== 'right' || getCompanionWindowsForPosition(state, { position: 'bottom', windowId }).length === 0;
const showMoveToBottom = !window.height || window.height > 300 || companionWindow.position !== 'right';
return {
...companionWindow,
isDisplayed: (companionWindow
......
......@@ -37,7 +37,6 @@ const mapDispatchToProps = {
setWindowHeight: actions.setWindowHeight,
};
const enhance = compose(
connect(mapStateToProps, mapDispatchToProps),
withSize({ monitorHeight: true, refreshMode: 'debounce' }),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment