fix room selecting

master
f0x 5 years ago
parent 05976128b1
commit 138c633134

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

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

Loading…
Cancel
Save