This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export function TextualCompletion({
13
13
< div style = { { width : '100%' } } >
14
14
< span > { title } </ span >
15
15
< em > { subtitle } </ em >
16
- < span style = { { color : 'gray' } } > { description } </ span >
16
+ < span style = { { color : 'gray' , float : 'right' } } > { description } </ span >
17
17
</ div >
18
18
) ;
19
19
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import Q from 'q';
4
4
import MatrixClientPeg from '../MatrixClientPeg' ;
5
5
import Fuse from 'fuse.js' ;
6
6
import { TextualCompletion } from './Components' ;
7
+ import { getDisplayAliasForRoom } from '../MatrixTools' ;
7
8
8
9
const ROOM_REGEX = / (? = # ) ( [ ^ \s ] * ) / g;
9
10
@@ -27,16 +28,18 @@ export default class RoomProvider extends AutocompleteProvider {
27
28
// the only reason we need to do this is because Fuse only matches on properties
28
29
this . fuse . set ( client . getRooms ( ) . filter ( room => ! ! room ) . map ( room => {
29
30
return {
31
+ room : room ,
30
32
name : room . name ,
31
33
roomId : room . roomId ,
32
34
aliases : room . getAliases ( ) ,
33
35
} ;
34
36
} ) ) ;
35
37
completions = this . fuse . search ( command [ 0 ] ) . map ( room => {
38
+ let displayAlias = getDisplayAliasForRoom ( room . room ) || room . roomId ;
36
39
return {
37
- completion : room . roomId ,
40
+ completion : displayAlias ,
38
41
component : (
39
- < TextualCompletion title = { room . name } subtitle = { room . roomId } />
42
+ < TextualCompletion title = { room . name } description = { displayAlias } />
40
43
) ,
41
44
range,
42
45
} ;
You can’t perform that action at this time.
0 commit comments