Skip to content

Commit a2a34d8

Browse files
Show the input bar as disabled until session state is ready
1 parent 100d546 commit a2a34d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/AssistantView.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ class AssistantView extends React.Component<Props, State> implements SessionCont
167167

168168
getInputView(): any {
169169
const { inputStyle, sendButtonStyle } = this.props;
170-
const { isProcessing } = this.state;
170+
const { isProcessing, sessionState } = this.state;
171+
const opacity = (isProcessing || sessionState != 'ready') ? 0.5 : 1;
171172
const inlineInputStyle = { border: 'solid', borderWidth: '1px', padding: '12px', borderColor: '#0000000D',
172-
width: '100%', borderRadius: '6px', background: '#00000005', height: '36px', opacity: isProcessing ? 0.5 : 1 };
173+
width: '100%', borderRadius: '6px', background: '#00000005', height: '36px', opacity };
173174
return <div ref={this.inputContainerRef} style={styles.inputContainer}>
174175
<InlineInput ref={this.inputRef} placeholder="Type here..." style={{ ...inlineInputStyle, ...inputStyle }} onEnter={this.sendChatMessage} />
175-
<div style={{ ...styles.sendButton, ...{ width: '96px', opacity: isProcessing ? 0.5 : 1 }, ...sendButtonStyle }} onClick={this.sendChatMessage}>Send</div>
176+
<div style={{ ...styles.sendButton, ...{ width: '96px', opacity }, ...sendButtonStyle }} onClick={this.sendChatMessage}>Send</div>
176177
</div>
177178
}
178179

0 commit comments

Comments
 (0)