fix room selecting

master
f0x 5 years ago
parent 05976128b1
commit 138c633134

@ -10,14 +10,14 @@ let FilterList = create({
getInitialState: function() {
return {
selection: -1,
selection: 0,
filter: ""
}
},
select: function(id) {
this.setState({selection: id})
this.props.callback(id)
//this.props.callback(id)
},
inputRef: function(ref) {
@ -39,7 +39,7 @@ let FilterList = create({
render: function() {
let items = this.props.items.map((item, id) => {
let props = {
active: this.state.selection == id,
selected: this.state.selection == id,
filter: this.state.filter,
content: item,
key: id,

@ -22,7 +22,7 @@ let RoomListItem = create({
return
}
this.setState({ref: ref})
ref.addEventListener("click", () => {this.props.select(this.props.roomId)})
ref.addEventListener("click", () => {this.props.select(this.props.listId)})
},
render: function() {
@ -30,7 +30,7 @@ let RoomListItem = create({
return null
}
let className = "roomListItem"
if (this.props.active) {
if (this.props.selected) {
className += " active"
}
if (this.state.unread) {

Loading…
Cancel
Save