add a *ignore* method to Promise to make tslint happy

pull/691/head
Audric Ackermann 5 years ago
parent d5b8436f4d
commit 8d11553fe5

@ -472,3 +472,9 @@ window.lokiFeatureFlags = {
multiDeviceUnpairing: true,
privateGroupChats: false,
};
// eslint-disable-next-line no-extend-native,func-names
Promise.prototype.ignore = function() {
// eslint-disable-next-line more/no-then
this.then(() => {});
};

@ -235,7 +235,7 @@ export class RegistrationTabs extends React.Component<Props, State> {
<SessionButton
onClick={() => {
if (signUpMode === SignUpMode.Default) {
void this.onSignUpGenerateSessionIDClick();
this.onSignUpGenerateSessionIDClick().ignore();
} else {
this.onSignUpGetStartedClick();
}
@ -417,7 +417,7 @@ export class RegistrationTabs extends React.Component<Props, State> {
return (
<SessionButton
onClick={() => {
void this.register('english');
this.register('english').ignore();
}}
buttonType={SessionButtonType.FullGreen}
text={this.props.i18n('continueYourSession')}

4
ts/global.d.ts vendored

@ -11,3 +11,7 @@ interface Window {
setPassword: any;
textsecure: any;
}
interface Promise<T> {
ignore(): void;
}

Loading…
Cancel
Save