extract buildRecents return type into an interface

pull/21833/head
Michael Telatynski 2021-05-27 17:00:48 +01:00
parent 60d161caf5
commit eef15394f2
1 changed files with 7 additions and 5 deletions

View File

@ -53,6 +53,12 @@ import AccessibleButton from '../elements/AccessibleButton';
// we have a number of types defined from the Matrix spec which can't reasonably be altered here. // we have a number of types defined from the Matrix spec which can't reasonably be altered here.
/* eslint-disable camelcase */ /* eslint-disable camelcase */
interface IRecentUser {
userId: string,
user: RoomMember,
lastActive: number,
}
export const KIND_DM = "dm"; export const KIND_DM = "dm";
export const KIND_INVITE = "invite"; export const KIND_INVITE = "invite";
export const KIND_CALL_TRANSFER = "call_transfer"; export const KIND_CALL_TRANSFER = "call_transfer";
@ -402,11 +408,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
this.setState({consultFirst: ev.target.checked}); this.setState({consultFirst: ev.target.checked});
} }
public static buildRecents(excludedTargetIds: Set<string>): { public static buildRecents(excludedTargetIds: Set<string>): IRecentUser[] {
userId: string,
user: RoomMember,
lastActive: number,
}[] {
const rooms = DMRoomMap.shared().getUniqueRoomsWithIndividuals(); // map of userId => js-sdk Room const rooms = DMRoomMap.shared().getUniqueRoomsWithIndividuals(); // map of userId => js-sdk Room
// Also pull in all the rooms tagged as DefaultTagID.DM so we don't miss anything. Sometimes the // Also pull in all the rooms tagged as DefaultTagID.DM so we don't miss anything. Sometimes the