s/that/self/g

This commit is contained in:
Matthew Hodgson 2015-07-17 21:59:48 +01:00
parent 0d34728190
commit 10cdf46c2c
10 changed files with 83 additions and 38 deletions

View file

@ -41,11 +41,11 @@ module.exports = {
},
componentDidMount: function() {
var that = this;
var self = this;
setTimeout(function() {
if (!that.isMounted()) return;
that.setState({
memberDict: that.roomMembers()
if (!self.isMounted()) return;
self.setState({
memberDict: self.roomMembers()
});
}, 50);
},

View file

@ -100,16 +100,16 @@ module.exports = {
},
makeRoomTiles: function() {
var that = this;
var self = this;
return this.state.roomList.map(function(room) {
var selected = room.roomId == that.props.selectedRoom;
var selected = room.roomId == self.props.selectedRoom;
return (
<RoomTile
room={room}
key={room.roomId}
selected={selected}
unread={that.state.activityMap[room.roomId] === 1}
highlight={that.state.activityMap[room.roomId] === 2}
unread={self.state.activityMap[room.roomId] === 1}
highlight={self.state.activityMap[room.roomId] === 2}
/>
);
});

View file

@ -163,12 +163,12 @@ module.exports = {
this.waiting_for_paginate = true;
var cap = this.state.messageCap + PAGINATE_SIZE;
this.setState({messageCap: cap, paginating: true});
var that = this;
var self = this;
MatrixClientPeg.get().scrollback(this.state.room, PAGINATE_SIZE).finally(function() {
that.waiting_for_paginate = false;
if (that.isMounted()) {
that.setState({
room: MatrixClientPeg.get().getRoom(that.props.roomId)
self.waiting_for_paginate = false;
if (self.isMounted()) {
self.setState({
room: MatrixClientPeg.get().getRoom(self.props.roomId)
});
}
// wait and set paginating to false when the component updates
@ -181,14 +181,14 @@ module.exports = {
},
onJoinButtonClicked: function(ev) {
var that = this;
var self = this;
MatrixClientPeg.get().joinRoom(this.props.roomId).then(function() {
that.setState({
self.setState({
joining: false,
room: MatrixClientPeg.get().getRoom(that.props.roomId)
room: MatrixClientPeg.get().getRoom(self.props.roomId)
});
}, function(error) {
that.setState({
self.setState({
joining: false,
joinError: error
});