Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"axios": "^0.18.0",
"dateformat": "^3.0.3",
"laravel-echo": "^1.3.5",
"preact": "^8.1.0",
"preact": "^8.4.2",
"preact-compat": "^3.15.0",
"preact-render-to-string": "^3.6.0",
"preact-router": "^2.5.1",
Expand Down
8 changes: 5 additions & 3 deletions src/chat/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ export default class Chat extends Component<IChatProps, IChatState> {
this.botman = botman;
this.botman.setUserId(this.props.userId);
this.botman.setChatServer(this.props.conf.chatServer);
this.state.messages = [];
this.state.replyType = ReplyType.Text;
//this.state.messages = [];
//this.state.replyType = ReplyType.Text;
this.setState({ messages : [] });
this.setState({ replyType : ReplyType.Text });
}

componentDidMount() {
Expand Down Expand Up @@ -223,4 +225,4 @@ interface IChatState {
messages: IMessage[],

replyType: string,
}
}
2 changes: 1 addition & 1 deletion src/chat/messages/action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Action extends MessageType {

performAction(action: IAction) {
botman.callAPI(action.value, true, null, (msg: IMessage) => {
this.state.attachmentsVisible = false;
this.setState({ attachmentsVisible : false});
this.props.messageHandler({
text: msg.text,
type: msg.type,
Expand Down
2 changes: 1 addition & 1 deletion src/chat/messages/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class ButtonsType extends MessageType {

performAction(button: IButton) {
botman.callAPI(button.payload, true, null, (msg: IMessage) => {
this.state.attachmentsVisible = false;
this.setState({ attachmentsVisible : false});
this.props.messageHandler({
text: msg.text,
type: msg.type,
Expand Down
6 changes: 3 additions & 3 deletions src/chat/messages/messagetype.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ export default abstract class MessageType extends Component<IMessageTypeProps, I
*/
componentDidMount() {
setTimeout(() => {
this.state.visible = true;
this.state.visibilityChanged = true;
this.setState({ visible : true });
this.setState({ visibilityChanged : true });
this.onVisibilityChange();
this.props.onVisibilityChange(this.props.message, this.state);
}, this.props.timeout || 0);
}

}
}
2 changes: 1 addition & 1 deletion src/chat/messages/typing-indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class TypingIndicator extends MessageType {

onVisibilityChange = () => {
setTimeout(() => {
this.state.visible = false;
this.setState({ visible : false});
this.props.onVisibilityChange(this.props.message, this.state);
}, this.props.message.timeout * 1000);
};
Expand Down
4 changes: 2 additions & 2 deletions src/widget/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const defaultConfiguration: IConfiguration = {
frameEndpoint: '/botman/chat',
timeFormat: 'HH:MM',
dateTimeFormat: 'm/d/yy HH:MM',
title: 'BotMan Widget',
title: 'Experian Help',
cookieValidInDays: 1,
introMessage: '',
placeholderText: 'Send a message...',
Expand All @@ -22,7 +22,7 @@ export const defaultConfiguration: IConfiguration = {
mobileWidth: '300px',
videoHeight: 160,
aboutLink: 'https://botman.io',
aboutText: '⚡ Powered by BotMan',
aboutText: '⚡ Powered by Botman',
chatId: '',
userId: '',
alwaysUseFloatingButton: false,
Expand Down