47 lines
2.0 KiB
Java
47 lines
2.0 KiB
Java
|
package c.a.a.c;
|
||
|
|
||
|
import c.a.a.c.k;
|
||
|
import com.discord.models.domain.ModelSubscription;
|
||
|
import com.discord.stores.StoreSubscriptions;
|
||
|
import d0.t.u;
|
||
|
import d0.z.d.m;
|
||
|
import d0.z.d.o;
|
||
|
import java.util.List;
|
||
|
import kotlin.Unit;
|
||
|
import kotlin.jvm.functions.Function1;
|
||
|
/* compiled from: PremiumGuildSubscriptionUncancelViewModel.kt */
|
||
|
public final class i extends o implements Function1<k.b, Unit> {
|
||
|
public final /* synthetic */ k this$0;
|
||
|
|
||
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
||
|
public i(k kVar) {
|
||
|
super(1);
|
||
|
this.this$0 = kVar;
|
||
|
}
|
||
|
|
||
|
/* 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 Unit invoke(k.b bVar) {
|
||
|
Object obj;
|
||
|
k.b bVar2 = bVar;
|
||
|
m.checkNotNullParameter(bVar2, "storeState");
|
||
|
k kVar = this.this$0;
|
||
|
if (!(kVar.getViewState() instanceof k.c.d) && !(kVar.getViewState() instanceof k.c.a)) {
|
||
|
StoreSubscriptions.SubscriptionsState subscriptionsState = bVar2.a;
|
||
|
if (subscriptionsState instanceof StoreSubscriptions.SubscriptionsState.Loading) {
|
||
|
obj = k.c.C0010c.a;
|
||
|
} else if (subscriptionsState instanceof StoreSubscriptions.SubscriptionsState.Failure) {
|
||
|
obj = new k.c.a(2131892237);
|
||
|
} else if (subscriptionsState instanceof StoreSubscriptions.SubscriptionsState.Loaded) {
|
||
|
ModelSubscription modelSubscription = (ModelSubscription) u.firstOrNull((List<? extends Object>) ((StoreSubscriptions.SubscriptionsState.Loaded) subscriptionsState).getSubscriptions());
|
||
|
obj = modelSubscription == null ? new k.c.a(2131892237) : new k.c.b(modelSubscription, false, false);
|
||
|
} else {
|
||
|
obj = new k.c.a(null, 1);
|
||
|
}
|
||
|
kVar.updateViewState(obj);
|
||
|
}
|
||
|
return Unit.a;
|
||
|
}
|
||
|
}
|