fix(core-ui): options panel close behavior

This commit is contained in:
Wroud
2021-02-26 02:08:32 +03:00
parent 2706d3ca4a
commit c96090fff2
2 changed files with 8 additions and 4 deletions
@@ -36,7 +36,11 @@ export class OptionsPanelService {
}
async open(component: () => React.FC): Promise<void> {
if (!(await this.close(component))) {
if (component === this.panelComponent) {
return;
}
if (!(await this.close())) {
return;
}
@@ -44,8 +48,8 @@ export class OptionsPanelService {
this.active = true;
}
async close(component: () => React.FC): Promise<boolean> {
if (component !== this.panelComponent || this.panelComponent === null) {
async close(): Promise<boolean> {
if (this.panelComponent === null) {
return true;
}
@@ -30,6 +30,6 @@ export class PublicConnectionFormService {
async close(): Promise<void> {
this.connectionId = null;
await this.optionsPanelService.close(formGetter);
await this.optionsPanelService.close();
}
}