Add SOCKET_SEARCH action constant
This commit is contained in:
parent
35f806c18d
commit
82e2343d5b
File diff suppressed because one or more lines are too long
@ -350,12 +350,24 @@ i[class^="icon-"]:before, i[class*=" icon-"]:before {
|
|||||||
right: 0;
|
right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-input {
|
.search-input-wrap {
|
||||||
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 15px;
|
background: #FFF;
|
||||||
border-bottom: 1px solid #DDD;
|
border-bottom: 1px solid #DDD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search i {
|
||||||
|
padding: 15px;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
flex: 1;
|
||||||
|
padding: 15px;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.search-results {
|
.search-results {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
|
@ -35,6 +35,7 @@ export const SOCKET_PART = 'SOCKET_PART';
|
|||||||
export const SOCKET_PM = 'SOCKET_PM';
|
export const SOCKET_PM = 'SOCKET_PM';
|
||||||
export const SOCKET_QUIT = 'SOCKET_QUIT';
|
export const SOCKET_QUIT = 'SOCKET_QUIT';
|
||||||
export const SOCKET_SERVERS = 'SOCKET_SERVERS';
|
export const SOCKET_SERVERS = 'SOCKET_SERVERS';
|
||||||
|
export const SOCKET_SEARCH = 'SOCKET_SEARCH';
|
||||||
export const SOCKET_TOPIC = 'SOCKET_TOPIC';
|
export const SOCKET_TOPIC = 'SOCKET_TOPIC';
|
||||||
export const SOCKET_USERS = 'SOCKET_USERS';
|
export const SOCKET_USERS = 'SOCKET_USERS';
|
||||||
export const TAB_HISTORY_POP = 'TAB_HISTORY_POP';
|
export const TAB_HISTORY_POP = 'TAB_HISTORY_POP';
|
||||||
|
@ -26,12 +26,15 @@ export default class Search extends Component {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="search" style={style}>
|
<div className="search" style={style}>
|
||||||
<input
|
<div className="search-input-wrap">
|
||||||
ref="input"
|
<i className="icon-search" />
|
||||||
className="search-input"
|
<input
|
||||||
type="text"
|
ref="input"
|
||||||
onChange={this.handleSearch}
|
className="search-input"
|
||||||
/>
|
type="text"
|
||||||
|
onChange={this.handleSearch}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className="search-results">{results}</div>
|
<div className="search-results">{results}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -62,11 +62,13 @@ func (u *User) GetLastMessages(server, channel string, count int) ([]Message, er
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if count < len(messages) {
|
if count == 0 {
|
||||||
|
return messages, nil
|
||||||
|
} else if count < len(messages) {
|
||||||
return messages[count:], nil
|
return messages[count:], nil
|
||||||
} else {
|
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) GetMessages(server, channel string, count int, fromID uint64) ([]Message, error) {
|
func (u *User) GetMessages(server, channel string, count int, fromID uint64) ([]Message, error) {
|
||||||
@ -89,7 +91,9 @@ func (u *User) GetMessages(server, channel string, count int, fromID uint64) ([]
|
|||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if count < len(messages) {
|
if count == 0 {
|
||||||
|
return messages, nil
|
||||||
|
} else if count < len(messages) {
|
||||||
return messages[count:], nil
|
return messages[count:], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user