2021-06-27 20:44:35 +00:00
|
|
|
package com.discord.widgets.auth;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import androidx.activity.result.ActivityResultLauncher;
|
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.view.validators.ValidationManager;
|
|
|
|
import com.discord.widgets.auth.WidgetAuthPhoneVerify;
|
|
|
|
import d0.t.u;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import java.util.Collection;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: WidgetAuthLogin.kt */
|
|
|
|
public final class WidgetAuthLogin$forgotPassword$2 extends o implements Function1<Error, Unit> {
|
|
|
|
public final /* synthetic */ String $login;
|
|
|
|
public final /* synthetic */ WidgetAuthLogin this$0;
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
|
|
public WidgetAuthLogin$forgotPassword$2(WidgetAuthLogin widgetAuthLogin, String str) {
|
|
|
|
super(1);
|
|
|
|
this.this$0 = widgetAuthLogin;
|
|
|
|
this.$login = str;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return type fixed from 'java.lang.Object' to match base method */
|
|
|
|
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Error error) {
|
|
|
|
invoke(error);
|
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final void invoke(Error error) {
|
|
|
|
m.checkNotNullParameter(error, "error");
|
|
|
|
Error.Response response = error.getResponse();
|
|
|
|
m.checkNotNullExpressionValue(response, "error.response");
|
|
|
|
if (response.getCode() == 70007) {
|
|
|
|
WidgetAuthPhoneVerify.Companion companion = WidgetAuthPhoneVerify.Companion;
|
|
|
|
Context requireContext = this.this$0.requireContext();
|
|
|
|
ActivityResultLauncher<Intent> access$getPhoneVerifyPasswordLauncher$p = WidgetAuthLogin.access$getPhoneVerifyPasswordLauncher$p(this.this$0);
|
|
|
|
String str = this.$login;
|
2021-07-19 19:45:22 +00:00
|
|
|
String string = this.this$0.getString(2131891938);
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(string, "getString(R.string.passw…overy_verify_phone_title)");
|
2021-07-19 19:45:22 +00:00
|
|
|
String string2 = this.this$0.getString(2131891936);
|
2021-06-27 20:44:35 +00:00
|
|
|
m.checkNotNullExpressionValue(string2, "getString(R.string.passw…ry_verify_phone_subtitle)");
|
|
|
|
companion.launch(requireContext, access$getPhoneVerifyPasswordLauncher$p, str, string, string2);
|
|
|
|
error.setShowErrorToasts(false);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
ValidationManager access$getValidationManager$p = WidgetAuthLogin.access$getValidationManager$p(this.this$0);
|
|
|
|
Error.Response response2 = error.getResponse();
|
|
|
|
m.checkNotNullExpressionValue(response2, "error.response");
|
|
|
|
Map<String, List<String>> messages = response2.getMessages();
|
|
|
|
m.checkNotNullExpressionValue(messages, "error.response.messages");
|
|
|
|
List<String> mutableList = u.toMutableList((Collection) access$getValidationManager$p.setErrors(messages));
|
|
|
|
WidgetAuthCaptcha.Companion.processErrorsForCaptcha(this.this$0.requireContext(), WidgetAuthLogin.access$getCaptchaForgotPasswordLauncher$p(this.this$0), mutableList, error);
|
|
|
|
error.setShowErrorToasts(!mutableList.isEmpty());
|
|
|
|
}
|
|
|
|
}
|