forked from Juby210/discord-jadx
62 lines
3.5 KiB
Java
62 lines
3.5 KiB
Java
package com.discord.widgets.guilds.profile;
|
|
|
|
import com.discord.utilities.error.Error;
|
|
import com.discord.widgets.guilds.profile.WidgetChangeGuildIdentityViewModel;
|
|
import d0.t.u;
|
|
import d0.z.d.m;
|
|
import d0.z.d.o;
|
|
import java.util.Collection;
|
|
import java.util.List;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.functions.Function1;
|
|
import rx.subjects.PublishSubject;
|
|
/* compiled from: WidgetChangeGuildIdentityViewModel.kt */
|
|
public final class WidgetChangeGuildIdentityViewModel$saveMemberChanges$1 extends o implements Function1<Error, Unit> {
|
|
public final /* synthetic */ WidgetChangeGuildIdentityViewModel.ViewState.Loaded $viewState;
|
|
public final /* synthetic */ WidgetChangeGuildIdentityViewModel this$0;
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public WidgetChangeGuildIdentityViewModel$saveMemberChanges$1(WidgetChangeGuildIdentityViewModel widgetChangeGuildIdentityViewModel, WidgetChangeGuildIdentityViewModel.ViewState.Loaded loaded) {
|
|
super(1);
|
|
this.this$0 = widgetChangeGuildIdentityViewModel;
|
|
this.$viewState = loaded;
|
|
}
|
|
|
|
/* 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) {
|
|
String str;
|
|
m.checkNotNullParameter(error, "it");
|
|
Error.Response response = error.getResponse();
|
|
m.checkNotNullExpressionValue(response, "it.response");
|
|
if (!response.getMessages().values().isEmpty()) {
|
|
Error.Response response2 = error.getResponse();
|
|
m.checkNotNullExpressionValue(response2, "it.response");
|
|
Object first = u.first(response2.getMessages().values());
|
|
m.checkNotNullExpressionValue(first, "it.response.messages.values.first()");
|
|
if (!((Collection) first).isEmpty()) {
|
|
Error.Response response3 = error.getResponse();
|
|
m.checkNotNullExpressionValue(response3, "it.response");
|
|
Object first2 = u.first(response3.getMessages().values());
|
|
m.checkNotNullExpressionValue(first2, "it.response.messages.values.first()");
|
|
str = (String) u.first((List<? extends Object>) ((List) first2));
|
|
PublishSubject access$getEventSubject$p = WidgetChangeGuildIdentityViewModel.access$getEventSubject$p(this.this$0);
|
|
access$getEventSubject$p.j.onNext(new WidgetChangeGuildIdentityViewModel.Event.MemberUpdateFailed(str));
|
|
WidgetChangeGuildIdentityViewModel.access$updateViewState(this.this$0, WidgetChangeGuildIdentityViewModel.ViewState.Loaded.copy$default(this.$viewState, null, null, null, false, null, null, false, 63, null));
|
|
}
|
|
}
|
|
Error.Response response4 = error.getResponse();
|
|
m.checkNotNullExpressionValue(response4, "it.response");
|
|
str = response4.getMessage();
|
|
PublishSubject access$getEventSubject$p = WidgetChangeGuildIdentityViewModel.access$getEventSubject$p(this.this$0);
|
|
access$getEventSubject$p.j.onNext(new WidgetChangeGuildIdentityViewModel.Event.MemberUpdateFailed(str));
|
|
WidgetChangeGuildIdentityViewModel.access$updateViewState(this.this$0, WidgetChangeGuildIdentityViewModel.ViewState.Loaded.copy$default(this.$viewState, null, null, null, false, null, null, false, 63, null));
|
|
}
|
|
}
|