2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.auth;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.content.Intent;
|
|
|
|
import androidx.activity.result.ActivityResultLauncher;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.t.u;
|
|
|
|
import c0.z.d.m;
|
|
|
|
import c0.z.d.o;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.view.validators.ValidationManager;
|
|
|
|
import com.discord.widgets.auth.WidgetAuthPhoneVerify;
|
|
|
|
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-08-09 22:51:56 +00:00
|
|
|
String string = this.this$0.getString(R.string.password_recovery_verify_phone_title);
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullExpressionValue(string, "getString(R.string.passw…overy_verify_phone_title)");
|
2021-08-09 22:51:56 +00:00
|
|
|
String string2 = this.this$0.getString(R.string.password_recovery_verify_phone_subtitle);
|
2021-08-03 07:33:18 +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());
|
|
|
|
}
|
|
|
|
}
|