Vendored
+1
-1
@@ -15,6 +15,6 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
declare module "*.svg" {
|
declare module "*.svg" {
|
||||||
const content: any;
|
const content: string;
|
||||||
export default content;
|
export default content;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ const addressTypeName = {
|
|||||||
'email': _td("email address"),
|
'email': _td("email address"),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
interface IResult {
|
||||||
|
user_id: string; // eslint-disable-line camelcase
|
||||||
|
room_id?: string; // eslint-disable-line camelcase
|
||||||
|
name?: string;
|
||||||
|
display_name?: string; // eslint-disable-line camelcase
|
||||||
|
avatar_url?: string;// eslint-disable-line camelcase
|
||||||
|
}
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
title: string;
|
title: string;
|
||||||
description?: JSX.Element;
|
description?: JSX.Element;
|
||||||
@@ -422,7 +430,7 @@ export default class AddressPickerDialog extends React.Component<IProps, IState>
|
|||||||
this.processResults(results, query);
|
this.processResults(results, query);
|
||||||
}
|
}
|
||||||
|
|
||||||
private processResults(results, query: string): void {
|
private processResults(results: IResult[], query: string): void {
|
||||||
const suggestedList = [];
|
const suggestedList = [];
|
||||||
results.forEach((result) => {
|
results.forEach((result) => {
|
||||||
if (result.room_id) {
|
if (result.room_id) {
|
||||||
@@ -490,7 +498,7 @@ export default class AddressPickerDialog extends React.Component<IProps, IState>
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private addAddressesToList(addressTexts): IUserAddress[] {
|
private addAddressesToList(addressTexts: string[]): IUserAddress[] {
|
||||||
const selectedList = this.state.selectedList.slice();
|
const selectedList = this.state.selectedList.slice();
|
||||||
|
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
@@ -533,7 +541,7 @@ export default class AddressPickerDialog extends React.Component<IProps, IState>
|
|||||||
return hasError ? null : selectedList;
|
return hasError ? null : selectedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async lookupThreepid(medium, address): Promise<string> {
|
private async lookupThreepid(medium: AddressType, address: string): Promise<string> {
|
||||||
let cancelled = false;
|
let cancelled = false;
|
||||||
// Note that we can't safely remove this after we're done
|
// Note that we can't safely remove this after we're done
|
||||||
// because we don't know that it's the same one, so we just
|
// because we don't know that it's the same one, so we just
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export default class AddressSelector extends React.Component<IProps, IState> {
|
|||||||
return addressList;
|
return addressList;
|
||||||
}
|
}
|
||||||
|
|
||||||
private maxSelected(list): number {
|
private maxSelected(list: IUserAddress[]): number {
|
||||||
const listSize = list.length === 0 ? 0 : list.length - 1;
|
const listSize = list.length === 0 ? 0 : list.length - 1;
|
||||||
const maxSelected = listSize > (this.props.truncateAt - 1) ? (this.props.truncateAt - 1) : listSize;
|
const maxSelected = listSize > (this.props.truncateAt - 1) ? (this.props.truncateAt - 1) : listSize;
|
||||||
return maxSelected;
|
return maxSelected;
|
||||||
|
|||||||
Reference in New Issue
Block a user