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

4
ts/global.d.ts vendored

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

Loading…
Cancel
Save