, enabled?: boolean,
});
props.events.reactUse("action_insert_text", event => {
refInput.current.innerHTML = refInput.current.innerHTML + event.text;
- if(event.focus) {
+ if (event.focus) {
refInput.current.focus();
}
});
props.events.reactUse("action_set_enabled", event => {
setEnabled(event.enabled);
- if(!event.enabled) {
+ if (!event.enabled) {
const text = refInput.current.innerText;
- if(text.trim().length !== 0)
+ if (text.trim().length !== 0)
history.current.push(text);
refInput.current.innerText = "";
}
@@ -324,17 +317,17 @@ export interface ChatBoxState {
}
const MarkdownFormatHelper = () => {
- const [ visible, setVisible ] = useState(settings.getValue(Settings.KEY_CHAT_ENABLE_MARKDOWN));
+ const [visible, setVisible] = useState(settings.getValue(Settings.KEY_CHAT_ENABLE_MARKDOWN));
settings.events.reactUse("notify_setting_changed", event => {
- if(event.setting !== Settings.KEY_CHAT_ENABLE_MARKDOWN.key) {
+ if (event.setting !== Settings.KEY_CHAT_ENABLE_MARKDOWN.key) {
return;
}
setVisible(settings.getValue(Settings.KEY_CHAT_ENABLE_MARKDOWN));
});
- if(visible) {
+ if (visible) {
return (
*italic*, **bold**, ~~strikethrough~~, `code`, and more...
);
@@ -380,7 +373,7 @@ export class ChatBox extends React.Component {
}
componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void {
- if(prevState.enabled !== this.state.enabled) {
+ if (prevState.enabled !== this.state.enabled) {
this.events.fire_react("action_set_enabled", { enabled: this.state.enabled });
}
}