Merge pull request #6735 from matrix-org/gsouquet/fix-18876

Fix state initialisation for DevicesPanel
This commit is contained in:
Germain 2021-09-03 11:08:30 +01:00 committed by GitHub
commit 2e237bfe70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ interface IProps {
interface IState { interface IState {
devices: IMyDevice[]; devices: IMyDevice[];
deviceLoadError?: string; deviceLoadError?: string;
selectedDevices?: string[]; selectedDevices: string[];
deleting?: boolean; deleting?: boolean;
} }
@ -43,6 +43,14 @@ interface IState {
export default class DevicesPanel extends React.Component<IProps, IState> { export default class DevicesPanel extends React.Component<IProps, IState> {
private unmounted = false; private unmounted = false;
constructor(props: IProps) {
super(props);
this.state = {
devices: [],
selectedDevices: [],
};
}
public componentDidMount(): void { public componentDidMount(): void {
this.loadDevices(); this.loadDevices();
} }