discord-jadx/app/src/main/java/com/discord/widgets/guilds/join/WidgetGuildJoinCaptchaBotto...

71 lines
3.4 KiB
Java

package com.discord.widgets.guilds.join;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import com.discord.app.AppFragment;
import com.discord.stores.StoreNotices;
import com.discord.stores.StoreStream;
import com.discord.utilities.captcha.CaptchaErrorBody;
import com.discord.widgets.guilds.join.WidgetGuildJoinCaptchaBottomSheet;
import com.discord.widgets.tabs.WidgetTabsHost;
import d0.z.d.a0;
import d0.z.d.m;
import d0.z.d.o;
import java.util.Iterator;
import java.util.List;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
/* compiled from: WidgetGuildJoinCaptchaBottomSheet.kt */
public final class WidgetGuildJoinCaptchaBottomSheet$Companion$enqueue$guildCaptchaNotice$1 extends o implements Function1<FragmentActivity, Boolean> {
public final /* synthetic */ CaptchaErrorBody $error;
public final /* synthetic */ Function2 $onCaptchaPayloadReceived;
public final /* synthetic */ String $requestKey;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public WidgetGuildJoinCaptchaBottomSheet$Companion$enqueue$guildCaptchaNotice$1(String str, CaptchaErrorBody captchaErrorBody, Function2 function2) {
super(1);
this.$requestKey = str;
this.$error = captchaErrorBody;
this.$onCaptchaPayloadReceived = function2;
}
/* 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 */ Boolean invoke(FragmentActivity fragmentActivity) {
return Boolean.valueOf(invoke(fragmentActivity));
}
public final boolean invoke(FragmentActivity fragmentActivity) {
Object obj;
m.checkNotNullParameter(fragmentActivity, "appActivity");
WidgetGuildJoinCaptchaBottomSheet.Companion companion = WidgetGuildJoinCaptchaBottomSheet.Companion;
FragmentManager supportFragmentManager = fragmentActivity.getSupportFragmentManager();
m.checkNotNullExpressionValue(supportFragmentManager, "appActivity.supportFragmentManager");
companion.show(supportFragmentManager, this.$requestKey, this.$error);
StoreNotices.markSeen$default(StoreStream.Companion.getNotices(), "guild captcha notice", 0, 2, null);
FragmentManager supportFragmentManager2 = fragmentActivity.getSupportFragmentManager();
m.checkNotNullExpressionValue(supportFragmentManager2, "appActivity.supportFragmentManager");
List<Fragment> fragments = supportFragmentManager2.getFragments();
m.checkNotNullExpressionValue(fragments, "appActivity.supportFragmentManager.fragments");
Iterator<T> it = fragments.iterator();
while (true) {
if (!it.hasNext()) {
obj = null;
break;
}
obj = it.next();
if (m.areEqual(a0.getOrCreateKotlinClass(((Fragment) obj).getClass()), a0.getOrCreateKotlinClass(WidgetTabsHost.class))) {
break;
}
}
Fragment fragment = (Fragment) obj;
if (fragment == null) {
return true;
}
WidgetGuildJoinCaptchaBottomSheet.Companion.registerForResult((AppFragment) fragment, this.$requestKey, this.$onCaptchaPayloadReceived);
return true;
}
}