Various fixes.

This commit is contained in:
Tomas Bures 2019-07-23 21:16:55 +05:30
parent 4e4b77ca84
commit 02360be75b
20 changed files with 3137 additions and 3124 deletions

View file

@ -37,6 +37,7 @@ const TableSelectMode = {
class Table extends Component {
constructor(props) {
super(props);
this.mounted = false;
this.selectionMap = this.getSelectionMap(props);
}
@ -184,6 +185,8 @@ class Table extends Component {
}
componentDidMount() {
this.mounted = true;
const columns = this.props.columns.slice();
// XSS protection and actions rendering
@ -364,12 +367,13 @@ class Table extends Component {
}
componentWillUnmount() {
this.mounted = false;
clearInterval(this.refreshIntervalId);
clearTimeout(this.refreshTimeoutId);
}
async notifySelection(eventCallback, newSelectionMap) {
if (eventCallback) {
if (this.mounted && eventCallback) {
const selPairs = Array.from(newSelectionMap).sort((l, r) => l[0] - r[0]);
let data = selPairs.map(entry => entry[1]);