discord-jadx/app/src/main/java/com/discord/stores/StoreApplication$fetchIfNon...

149 lines
7.0 KiB
Java

package com.discord.stores;
import android.content.Context;
import com.discord.api.application.Application;
import com.discord.utilities.error.Error;
import com.discord.utilities.rest.RestAPI;
import com.discord.utilities.rx.ObservableExtensionsKt;
import d0.z.d.m;
import d0.z.d.o;
import java.util.Iterator;
import java.util.List;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
/* compiled from: StoreApplication.kt */
public final class StoreApplication$fetchIfNonexisting$1 extends o implements Function0<Unit> {
public final /* synthetic */ long $appId;
public final /* synthetic */ StoreApplication this$0;
/* compiled from: StoreApplication.kt */
/* renamed from: com.discord.stores.StoreApplication$fetchIfNonexisting$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<List<? extends Application>, Unit> {
public final /* synthetic */ StoreApplication$fetchIfNonexisting$1 this$0;
/* compiled from: StoreApplication.kt */
/* renamed from: com.discord.stores.StoreApplication$fetchIfNonexisting$1$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Unit> {
public final /* synthetic */ List $results;
public final /* synthetic */ AnonymousClass1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(AnonymousClass1 r1, List list) {
super(0);
this.this$0 = r1;
this.$results = list;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
Object obj;
boolean z2;
StoreApplication.access$getApplicationsLoading$p(this.this$0.this$0.this$0).remove(Long.valueOf(this.this$0.this$0.$appId));
Iterator it = this.$results.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (((Application) obj).f() == this.this$0.this$0.$appId) {
z2 = true;
continue;
} else {
z2 = false;
continue;
}
if (z2) {
break;
}
}
Application application = (Application) obj;
if (application != null) {
StoreApplication.access$getApplications$p(this.this$0.this$0.this$0).put(Long.valueOf(this.this$0.this$0.$appId), application);
this.this$0.this$0.this$0.markChanged();
}
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(StoreApplication$fetchIfNonexisting$1 storeApplication$fetchIfNonexisting$1) {
super(1);
this.this$0 = storeApplication$fetchIfNonexisting$1;
}
/* 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(List<? extends Application> list) {
invoke((List<Application>) list);
return Unit.a;
}
public final void invoke(List<Application> list) {
m.checkNotNullParameter(list, "results");
StoreApplication.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this, list));
}
}
/* compiled from: StoreApplication.kt */
/* renamed from: com.discord.stores.StoreApplication$fetchIfNonexisting$1$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function1<Error, Unit> {
public final /* synthetic */ StoreApplication$fetchIfNonexisting$1 this$0;
/* compiled from: StoreApplication.kt */
/* renamed from: com.discord.stores.StoreApplication$fetchIfNonexisting$1$2$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function0<Unit> {
public final /* synthetic */ AnonymousClass2 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(AnonymousClass2 r1) {
super(0);
this.this$0 = r1;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
StoreApplication.access$getApplicationsLoading$p(this.this$0.this$0.this$0).remove(Long.valueOf(this.this$0.this$0.$appId));
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(StoreApplication$fetchIfNonexisting$1 storeApplication$fetchIfNonexisting$1) {
super(1);
this.this$0 = storeApplication$fetchIfNonexisting$1;
}
/* 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, "it");
StoreApplication.access$getDispatcher$p(this.this$0.this$0).schedule(new AnonymousClass1(this));
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public StoreApplication$fetchIfNonexisting$1(StoreApplication storeApplication, long j) {
super(0);
this.this$0 = storeApplication;
this.$appId = j;
}
@Override // kotlin.jvm.functions.Function0
/* renamed from: invoke */
public final void mo1invoke() {
if (!StoreApplication.access$getApplications$p(this.this$0).containsKey(Long.valueOf(this.$appId)) && !StoreApplication.access$getApplicationsLoading$p(this.this$0).contains(Long.valueOf(this.$appId))) {
StoreApplication.access$getApplicationsLoading$p(this.this$0).add(Long.valueOf(this.$appId));
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().getApplications(this.$appId), false, 1, null), this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass2(this), (Function0) null, (Function0) null, new AnonymousClass1(this), 54, (Object) null);
}
}
}