Extract error message popup

This commit is contained in:
Simon Ser 2021-03-08 15:05:43 +01:00
parent 194168c062
commit 996d7d06d4

View file

@ -947,6 +947,13 @@ export default class App extends Component {
`;
}
var error = null;
if (this.state.error) {
error = html`
<p id="error-msg">${this.state.error} <a href="#" onClick=${this.dismissError}>×</a></p>
`;
}
return html`
<section id="buffer-list">
<${BufferList} buffers=${this.state.buffers} networks=${this.state.networks} activeBuffer=${this.state.activeBuffer} onBufferClick=${this.handleBufferListClick}/>
@ -959,9 +966,7 @@ export default class App extends Component {
</>
${memberList}
<${Composer} ref=${this.composer} readOnly=${activeBuffer && activeBuffer.type == BufferType.SERVER} onSubmit=${this.handleComposerSubmit} autocomplete=${this.autocomplete}/>
${this.state.error ? html`
<p id="error-msg">${this.state.error} <a href="#" onClick=${this.dismissError}>×</a></p>
` : null}
${error}
`;
}
}