Skip to content

Commit 609a6c5

Browse files
committed
rename handler
1 parent 0c870db commit 609a6c5

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ import { MessageBox } from 'react-chat-elements'
136136
| onOpen | none | function | message on open (file or photo) (message(object) is returned) |
137137
| onDownload | none | function | message on download (file or photo) (message(object) is returned) |
138138
| onLoad | none | function | message on load photo |
139-
| onError | none | function | message on error photo |
139+
| onPhotoError | none | function | message on error photo |
140140
| onTitleClick | none | function | message title on click event |
141141
| onForwardClick | none | function | message forward on click event |
142142
| onContextMenu | none | function | message contextmenu click event |
@@ -207,7 +207,7 @@ import { MessageList } from 'react-chat-elements'
207207
| downButtonBadge | none | boolean | message list downButton badge content |
208208
| onDownButtonClick | none | function | message list onDownButtonClick |
209209
| onContextMenu | none | function | message list item onContextMenu event, gets 3 parameters: message item, index of item, event |
210-
| onError | none | function | message list item on error photo |
210+
| onPhotoError | none | function | message list item on error photo |
211211

212212
## ChatList Component
213213

src/MessageBox/MessageBox.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class MessageBox extends Component {
130130
onOpen={this.props.onOpen}
131131
onDownload={this.props.onDownload}
132132
onLoad={this.props.onLoad}
133-
onError={this.props.onError}
133+
onPhotoError={this.props.onPhotoError}
134134
data={this.props.data}
135135
width={this.props.width}
136136
height={this.props.height}
@@ -248,7 +248,7 @@ MessageBox.defaultProps = {
248248
onOpen: null,
249249
onDownload: null,
250250
onLoad: null,
251-
onError: null,
251+
onPhotoError: null,
252252
forwarded: false,
253253
status: null,
254254
dateString: null,

src/MessageList/MessageList.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ export class MessageList extends Component {
5959
this.props.onDownload(item, i, e);
6060
}
6161

62-
onError(item, i, e) {
63-
if (this.props.onError instanceof Function)
64-
this.props.onError(item, i, e);
62+
onPhotoError(item, i, e) {
63+
if (this.props.onPhotoError instanceof Function)
64+
this.props.onPhotoError(item, i, e);
6565
}
6666

6767
onClick(item, i, e) {
@@ -144,7 +144,7 @@ export class MessageList extends Component {
144144
key={i}
145145
{...x}
146146
onOpen={this.props.onOpen && ((e) => this.onOpen(x, i, e))}
147-
onError={this.props.onError && ((e) => this.onError(x, i, e))}
147+
onPhotoError={this.props.onPhotoError && ((e) => this.onPhotoError(x, i, e))}
148148
onDownload={this.props.onDownload && ((e) => this.onDownload(x, i, e))}
149149
onTitleClick={this.props.onTitleClick && ((e) => this.onTitleClick(x, i, e))}
150150
onForwardClick={this.props.onForwardClick && ((e) => this.onForwardClick(x, i, e))}
@@ -183,7 +183,7 @@ MessageList.defaultProps = {
183183
onForwardClick: null,
184184
onDownButtonClick: null,
185185
onOpen: null,
186-
onError: null,
186+
onPhotoError: null,
187187
onDownload: null,
188188
dataSource: [],
189189
lockable: false,

src/PhotoMessage/PhotoMessage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class PhotoMessage extends Component {
4242
alt={this.props.data.alt}
4343
onClick={this.props.onOpen}
4444
onLoad={this.props.onLoad}
45-
onError={this.props.onError}/>
45+
onPhototError={this.props.onPhototError}/>
4646
{
4747
error &&
4848
<div className="rce-mbox-photo--img__block">
@@ -94,7 +94,7 @@ PhotoMessage.defaultProps = {
9494
onDownload: null,
9595
onOpen: null,
9696
onLoad: null,
97-
onError: null,
97+
onPhototError: null,
9898
};
9999

100100

0 commit comments

Comments
 (0)