mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
- fix resetting of modalIC (cherry-picking changes from 38f0aa7c
)
- do not refresh ICs if dialog is open
This commit is contained in:
parent
c04d031297
commit
ea1b74ea01
1 changed files with 5 additions and 8 deletions
|
@ -101,7 +101,7 @@ class InfrastructureComponents extends Component {
|
|||
services: services,
|
||||
equipment: equipment,
|
||||
numberOfExternalICs,
|
||||
modalIC: {},
|
||||
modalIC: prevState.modalIC || {},
|
||||
deleteModal: false,
|
||||
icModal: false,
|
||||
selectedICs: prevState.selectedICs || [],
|
||||
|
@ -126,6 +126,7 @@ class InfrastructureComponents extends Component {
|
|||
refresh() {
|
||||
if (this.state.editModal || this.state.deleteModal || this.state.icModal){
|
||||
// do nothing since a dialog is open at the moment
|
||||
return
|
||||
}
|
||||
else {
|
||||
AppDispatcher.dispatch({
|
||||
|
@ -187,13 +188,9 @@ class InfrastructureComponents extends Component {
|
|||
}
|
||||
|
||||
closeEditModal(data) {
|
||||
this.setState({ editModal : false });
|
||||
this.setState({ editModal : false, modalIC: {} });
|
||||
|
||||
if (data) {
|
||||
//let ic = this.state.ics[this.state.modalIndex];
|
||||
//ic = data;
|
||||
//this.setState({ ic: ic });
|
||||
|
||||
AppDispatcher.dispatch({
|
||||
type: 'ics/start-edit',
|
||||
data: data,
|
||||
|
@ -204,8 +201,6 @@ class InfrastructureComponents extends Component {
|
|||
|
||||
|
||||
closeDeleteModal(confirmDelete){
|
||||
this.setState({ deleteModal: false });
|
||||
|
||||
if (confirmDelete === false) {
|
||||
return;
|
||||
}
|
||||
|
@ -215,6 +210,8 @@ class InfrastructureComponents extends Component {
|
|||
data: this.state.modalIC,
|
||||
token: this.state.sessionToken,
|
||||
});
|
||||
|
||||
this.setState({ deleteModal: false, modalIC: {} });
|
||||
}
|
||||
|
||||
exportIC(index) {
|
||||
|
|
Loading…
Add table
Reference in a new issue