Apply corrections identified by SonarQube (#8457)

This commit is contained in:
Michael Telatynski 2022-05-03 22:04:37 +01:00 committed by GitHub
parent 99cb83a9df
commit 964c60d086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 211 additions and 232 deletions

View file

@ -200,7 +200,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
}, {
key: "number",
test: ({ value }) => {
const parsedSize = parseInt(value as string, 10);
const parsedSize = parseInt(value, 10);
return validateNumberInRange(1, 2000)(parsedSize);
},
invalid: () => {
@ -238,7 +238,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
}, {
key: "number",
test: ({ value }) => {
const parsedSize = parseInt(value as string, 10);
const parsedSize = parseInt(value, 10);
return validateNumberInRange(1, 10 ** 8)(parsedSize);
},
invalid: () => {

View file

@ -138,7 +138,8 @@ export default class MessageEditHistoryDialog extends React.PureComponent<IProps
isBaseEvent={isBaseEvent}
mxEvent={e}
isTwelveHour={this.state.isTwelveHour}
/>));
/>
));
lastEvent = e;
});
return nodes;

View file

@ -367,16 +367,16 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", onFinished }) =>
);
}
const otherResult = (result as IResult);
// IResult case
return (
<Option
id={`mx_SpotlightDialog_button_result_${otherResult.name}`}
key={otherResult.name}
onClick={otherResult.onClick}
id={`mx_SpotlightDialog_button_result_${result.name}`}
key={result.name}
onClick={result.onClick}
>
{ otherResult.avatar }
{ otherResult.name }
{ otherResult.description }
{ result.avatar }
{ result.name }
{ result.description }
</Option>
);
};

View file

@ -93,7 +93,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
private doBootstrapUIAuth = async (makeRequest: (authData: any) => void): Promise<void> => {
if (this.state.canUploadKeysWithPasswordOnly && this.state.accountPassword) {
await makeRequest({
makeRequest({
type: 'm.login.password',
identifier: {
type: 'm.id.user',
@ -106,7 +106,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
});
} else if (this.props.tokenLogin) {
// We are hoping the grace period is active
await makeRequest({});
makeRequest({});
} else {
const dialogAesthetics = {
[SSOAuthEntry.PHASE_PREAUTH]: {