Make SonarCloud happier (#9545)
* Make SonarCloud happier * i18n * Iterate * Update AddExistingToSpaceDialog.tsx * Update SlashCommands.tsx
This commit is contained in:
parent
77764d80bc
commit
3747464b41
33 changed files with 131 additions and 162 deletions
|
@ -716,7 +716,7 @@ export const Commands = [
|
|||
runFn: function(roomId, args) {
|
||||
const cli = MatrixClientPeg.get();
|
||||
|
||||
let targetRoomId: string;
|
||||
let targetRoomId: string | undefined;
|
||||
if (args) {
|
||||
const matches = args.match(/^(\S+)$/);
|
||||
if (matches) {
|
||||
|
@ -729,15 +729,9 @@ export const Commands = [
|
|||
|
||||
// Try to find a room with this alias
|
||||
const rooms = cli.getRooms();
|
||||
for (let i = 0; i < rooms.length; i++) {
|
||||
if (rooms[i].getCanonicalAlias() === roomAlias ||
|
||||
rooms[i].getAltAliases().includes(roomAlias)
|
||||
) {
|
||||
targetRoomId = rooms[i].roomId;
|
||||
break;
|
||||
}
|
||||
if (targetRoomId) break;
|
||||
}
|
||||
targetRoomId = rooms.find(room => {
|
||||
return room.getCanonicalAlias() === roomAlias || room.getAltAliases().includes(roomAlias);
|
||||
})?.roomId;
|
||||
if (!targetRoomId) {
|
||||
return reject(
|
||||
newTranslatableError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue