Fix config becoming unblocked while still in progress

This commit is contained in:
Ingvar Stepanyan
2021-07-12 13:09:42 +00:00
parent d0a53669d2
commit 6e28a0caac

12
ui.html
View File

@@ -112,7 +112,7 @@
}
class Settings extends Component {
state = { inProgress: true, config: 'Connecting...' };
state = { inProgress: false, config: 'Connecting...' };
constructor() {
super();
@@ -124,10 +124,6 @@
})();
}
setStatePromise(state) {
return new Promise(resolve => this.setState(state, resolve));
}
handleInput = async e => {
let name = e.target.id;
if (!name.startsWith('config-')) {
@@ -147,7 +143,7 @@
break;
}
await this.setStatePromise({ inProgress: true });
this.setState({ inProgress: true });
try {
await scheduleOp(() => context.setConfigValue(name, value));
@@ -156,6 +152,7 @@
}
await this.refreshConfig();
this.setState({ inProgress: false });
};
async refreshConfig() {
@@ -165,8 +162,7 @@
} catch (e) {
config = String(e);
}
await this.setStatePromise({
inProgress: false,
this.setState({
config
});
}