DRY matrix.to link generation so it is all changeable in one class
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
4666ac7c83
commit
5c229b9ef8
5 changed files with 11 additions and 9 deletions
|
@ -25,6 +25,7 @@ import {PillCompletion} from './Components';
|
|||
import {getDisplayAliasForRoom} from '../Rooms';
|
||||
import sdk from '../index';
|
||||
import _sortBy from 'lodash/sortBy';
|
||||
import {makeRoomPermalink} from "../matrix-to";
|
||||
|
||||
const ROOM_REGEX = /(?=#)(\S*)/g;
|
||||
|
||||
|
@ -78,7 +79,7 @@ export default class RoomProvider extends AutocompleteProvider {
|
|||
return {
|
||||
completion: displayAlias,
|
||||
suffix: ' ',
|
||||
href: 'https://matrix.to/#/' + displayAlias,
|
||||
href: makeRoomPermalink(displayAlias),
|
||||
component: (
|
||||
<PillCompletion initialComponent={<RoomAvatar width={24} height={24} room={room.room} />} title={room.name} description={displayAlias} />
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue