File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/stores/room-list/filters Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,14 @@ export class NameFilterCondition extends EventEmitter implements IFilterConditio
5656 return true ;
5757 }
5858 }
59- return room . name && removeHiddenChars ( room . name ) . toLowerCase ( ) . includes ( lcFilter ) ;
59+
60+ if ( ! room . name ) return false ; // should realisitically not happen: the js-sdk always calculates a name
61+
62+ // Note: we have to match the filter with the removeHiddenChars() room name because the
63+ // function strips spaces and other characters (M becomes RN for example, in lowercase).
64+ // We also doubly convert to lowercase to work around oddities of the library.
65+ const noSecretsFilter = removeHiddenChars ( lcFilter ) . toLowerCase ( ) ;
66+ const noSecretsName = removeHiddenChars ( room . name . toLowerCase ( ) ) . toLowerCase ( ) ;
67+ return noSecretsName . includes ( noSecretsFilter ) ;
6068 }
6169}
You can’t perform that action at this time.
0 commit comments