51 lines
2.0 KiB
Java
51 lines
2.0 KiB
Java
package com.discord.widgets.auth;
|
|
|
|
import com.discord.app.AppActivity;
|
|
import com.discord.utilities.error.Error;
|
|
import d0.t.g0;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
/* compiled from: WidgetOauth2Authorize.kt */
|
|
public final class WidgetOauth2Authorize$onViewBoundOrOnResume$1 extends o implements Function1<Error, Unit> {
|
|
public final /* synthetic */ WidgetOauth2Authorize this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetOauth2Authorize$onViewBoundOrOnResume$1(WidgetOauth2Authorize widgetOauth2Authorize) {
|
|
super(1);
|
|
this.this$0 = widgetOauth2Authorize;
|
|
}
|
|
|
|
/* 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");
|
|
Map<String, List<String>> messages = response.getMessages();
|
|
m.checkNotNullExpressionValue(messages, "it");
|
|
if (!(!messages.isEmpty())) {
|
|
messages = null;
|
|
}
|
|
if (messages == null) {
|
|
Error.Response response2 = error.getResponse();
|
|
m.checkNotNullExpressionValue(response2, "error.response");
|
|
messages = g0.mapOf(d0.o.to("_root", d0.t.m.listOf(response2.getMessage())));
|
|
}
|
|
error.setShowErrorToasts(!WidgetOauth2Authorize.access$getValidationManager$p(this.this$0).setErrors(messages).isEmpty());
|
|
AppActivity appActivity = this.this$0.getAppActivity();
|
|
if (appActivity != null) {
|
|
appActivity.onBackPressed();
|
|
}
|
|
}
|
|
}
|