@@ -15,7 +15,7 @@ limitations under the License.
15
15
*/
16
16
17
17
import { TemplateView } from "./utils/TemplateView.js" ;
18
- import { LinkKind } from "./Link.js" ;
18
+ import { LinkKind , IdentifierKind } from "./Link.js" ;
19
19
20
20
export class InvalidUrlView extends TemplateView {
21
21
render ( t , vm ) {
@@ -29,20 +29,27 @@ export class InvalidUrlView extends TemplateView {
29
29
] ) ;
30
30
}
31
31
32
- _describeLinkKind ( kind ) {
33
- switch ( kind ) {
34
- case LinkKind . Room : return "The room " ;
32
+ _describeRoom ( identifierKind ) {
33
+ return identifierKind === IdentifierKind . RoomAlias ? "room alias" : "room" ;
34
+ }
35
+
36
+ _describeLinkKind ( linkKind , identifierKind ) {
37
+ switch ( linkKind ) {
38
+ case LinkKind . Room : return `The ${ this . _describeRoom ( identifierKind ) } ` ;
35
39
case LinkKind . User : return "The user " ;
36
40
case LinkKind . Group : return "The group " ;
37
- case LinkKind . Event : return " An event in room " ;
41
+ case LinkKind . Event : return ` An event in ${ this . _describeRoom ( identifierKind ) } ` ;
38
42
}
39
43
}
40
44
41
45
_renderValidFixes ( t , validFixes ) {
42
46
return t . p ( [
43
47
'Did you mean any of the following?' ,
44
48
t . ul ( validFixes . map ( fix =>
45
- t . li ( [ this . _describeLinkKind ( fix . link . kind ) , t . a ( { href : fix . url } , fix . link . identifier ) ] )
49
+ t . li ( [
50
+ this . _describeLinkKind ( fix . link . kind , fix . link . identifierKind ) ,
51
+ t . a ( { href : fix . url } , fix . link . identifier )
52
+ ] )
46
53
) )
47
54
] ) ;
48
55
}
0 commit comments