forked from nutomic/lemmy
Spam
This commit is contained in:
parent
018cbe1fee
commit
170d1b6f0a
1 changed files with 9 additions and 1 deletions
|
@ -10,6 +10,7 @@ interface State {
|
||||||
registerForm: RegisterForm;
|
registerForm: RegisterForm;
|
||||||
loginLoading: boolean;
|
loginLoading: boolean;
|
||||||
registerLoading: boolean;
|
registerLoading: boolean;
|
||||||
|
spamNada: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ export class Login extends Component<any, State> {
|
||||||
},
|
},
|
||||||
loginLoading: false,
|
loginLoading: false,
|
||||||
registerLoading: false,
|
registerLoading: false,
|
||||||
|
spamNada: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props: any, context: any) {
|
constructor(props: any, context: any) {
|
||||||
|
@ -126,6 +128,7 @@ export class Login extends Component<any, State> {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" value={this.state.registerForm.spam_timer} />
|
<input type="hidden" value={this.state.registerForm.spam_timer} />
|
||||||
|
<input type="text" class="d-none" value={this.state.spamNada} onInput={linkEvent(this, this.handleSpamNada)} />
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<button type="submit" class="btn btn-secondary">{this.state.registerLoading ?
|
<button type="submit" class="btn btn-secondary">{this.state.registerLoading ?
|
||||||
|
@ -164,7 +167,7 @@ export class Login extends Component<any, State> {
|
||||||
let elapsed = endTimer - i.state.registerForm.spam_timer;
|
let elapsed = endTimer - i.state.registerForm.spam_timer;
|
||||||
|
|
||||||
i.state.registerForm.spam_timer = elapsed;
|
i.state.registerForm.spam_timer = elapsed;
|
||||||
if (elapsed > 1142) {
|
if (elapsed > 1142 && i.state.spamNada == undefined) {
|
||||||
WebSocketService.Instance.register(i.state.registerForm);
|
WebSocketService.Instance.register(i.state.registerForm);
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "https://github.com/dessalines/lemmy";
|
window.location.href = "https://github.com/dessalines/lemmy";
|
||||||
|
@ -177,6 +180,11 @@ export class Login extends Component<any, State> {
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleSpamNada(i: Login, event: any) {
|
||||||
|
i.state.spamNada = event.target.value;
|
||||||
|
i.setState(i.state);
|
||||||
|
}
|
||||||
|
|
||||||
handleRegisterEmailChange(i: Login, event: any) {
|
handleRegisterEmailChange(i: Login, event: any) {
|
||||||
i.state.registerForm.email = event.target.value;
|
i.state.registerForm.email = event.target.value;
|
||||||
i.setState(i.state);
|
i.setState(i.state);
|
||||||
|
|
Loading…
Reference in a new issue