2021-08-03 07:33:18 +00:00
|
|
|
package com.discord.widgets.settings.account;
|
|
|
|
|
|
|
|
import android.content.Context;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.R;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.api.auth.mfa.DisableMfaRequestBody;
|
|
|
|
import com.discord.api.auth.mfa.DisableMfaResponse;
|
2021-08-09 22:51:56 +00:00
|
|
|
import com.discord.models.domain.ModelAuditLogEntry;
|
2021-08-03 07:33:18 +00:00
|
|
|
import com.discord.stores.StoreMFA;
|
|
|
|
import com.discord.stores.StoreStream;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
2021-08-03 07:33:18 +00:00
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
import kotlin.jvm.functions.Function2;
|
|
|
|
/* compiled from: WidgetSettingsAccount.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class WidgetSettingsAccount$showRemove2FAModal$1 extends o implements Function2<Context, String, Unit> {
|
|
|
|
public final /* synthetic */ WidgetSettingsAccount this$0;
|
|
|
|
|
|
|
|
/* compiled from: WidgetSettingsAccount.kt */
|
|
|
|
/* renamed from: com.discord.widgets.settings.account.WidgetSettingsAccount$showRemove2FAModal$1$1 reason: invalid class name */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes2.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final class AnonymousClass1 extends o implements Function1<DisableMfaResponse, Unit> {
|
2022-03-07 09:34:54 +00:00
|
|
|
public AnonymousClass1() {
|
2021-08-03 07:33:18 +00:00
|
|
|
super(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(DisableMfaResponse disableMfaResponse) {
|
2022-03-07 09:34:54 +00:00
|
|
|
invoke2(disableMfaResponse);
|
2021-08-03 07:33:18 +00:00
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2(DisableMfaResponse disableMfaResponse) {
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullParameter(disableMfaResponse, "it");
|
2022-03-07 09:34:54 +00:00
|
|
|
b.a.d.m.h(WidgetSettingsAccount$showRemove2FAModal$1.this.this$0.requireContext(), WidgetSettingsAccount$showRemove2FAModal$1.this.this$0.requireContext().getString(R.string.user_settings_mfa_removed), 0, null, 12);
|
2021-08-03 07:33:18 +00:00
|
|
|
StoreStream.Companion companion = StoreStream.Companion;
|
|
|
|
companion.getAuthentication().setAuthed(disableMfaResponse.a());
|
|
|
|
companion.getMFA().updatePendingMFAState(StoreMFA.MFAActivationState.PENDING_DISABLED);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
2021-08-03 07:33:18 +00:00
|
|
|
public WidgetSettingsAccount$showRemove2FAModal$1(WidgetSettingsAccount widgetSettingsAccount) {
|
|
|
|
super(2);
|
|
|
|
this.this$0 = widgetSettingsAccount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function2
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Context context, String str) {
|
2022-03-07 09:34:54 +00:00
|
|
|
invoke2(context, str);
|
2021-08-03 07:33:18 +00:00
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2(Context context, String str) {
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkNotNullParameter(context, "<anonymous parameter 0>");
|
2021-08-09 22:51:56 +00:00
|
|
|
m.checkNotNullParameter(str, ModelAuditLogEntry.CHANGE_KEY_CODE);
|
2022-03-14 07:58:47 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(ObservableExtensionsKt.withDimmer$default(ObservableExtensionsKt.ui$default(RestAPI.Companion.getApi().disableMFA(new DisableMfaRequestBody(str)), this.this$0, null, 2, null), WidgetSettingsAccount.access$getBinding$p(this.this$0).f2569b, 0L, 2, null), false, 1, null), WidgetSettingsAccount.class, this.this$0.requireContext(), (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(), 60, (Object) null);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|