1340 lines
42 KiB
Smali
1340 lines
42 KiB
Smali
.class public final Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
|
.super Le/a/b/c0;
|
|
.source "SettingsPremiumViewModel.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionAndInvoice;,
|
|
Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Factory;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Le/a/b/c0<",
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public launchPremiumTabStartTimeMs:J
|
|
|
|
.field public final requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lrx/subjects/PublishSubject<",
|
|
"Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
.field public final storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
.field public final storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
.field public final storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/stores/StoreEntitlements;Lcom/discord/stores/StorePremiumGuildSubscription;Lrx/Observable;)V
|
|
.locals 10
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Lcom/discord/stores/StorePaymentSources;",
|
|
"Lcom/discord/stores/StoreSubscriptions;",
|
|
"Lcom/discord/stores/StoreEntitlements;",
|
|
"Lcom/discord/stores/StorePremiumGuildSubscription;",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_4
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
if-eqz p3, :cond_2
|
|
|
|
if-eqz p4, :cond_1
|
|
|
|
if-eqz p5, :cond_0
|
|
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;
|
|
|
|
invoke-direct {p0, v1}, Le/a/b/c0;-><init>(Ljava/lang/Object;)V
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
iput-object p3, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
iput-object p4, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->o()Lrx/subjects/PublishSubject;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
invoke-static {p5}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->computationLatest(Lrx/Observable;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 p2, 0x2
|
|
|
|
invoke-static {p1, p0, v0, p2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v1
|
|
|
|
const-class v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
new-instance v7, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$1;
|
|
|
|
invoke-direct {v7, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
const/16 v8, 0x1e
|
|
|
|
const/4 v9, 0x0
|
|
|
|
invoke-static/range {v1 .. v9}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->appSubscribe$default(Lrx/Observable;Ljava/lang/Class;Landroid/content/Context;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "storeObservable"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "storePremiumGuildSubscription"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
const-string p1, "storeEntitlements"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p1, "storeSubscriptions"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_4
|
|
const-string p1, "storePaymentsSources"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$fetchData(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onCancelError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onCancelError()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onChangePaymentSourceError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onChangePaymentSourceError()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$onResubscribeError(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onResubscribeError()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final fetchData()V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePaymentSources;->fetchPaymentSources()V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreSubscriptions;->fetchSubscriptions()V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
const-wide v1, 0x73df54a4a020016L
|
|
|
|
invoke-virtual {v0, v1, v2}, Lcom/discord/stores/StoreEntitlements;->fetchMyEntitlementsForApplication(J)V
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePremiumGuildSubscription;->fetchUserGuildPremiumState()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final handleStoreState(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;)V
|
|
.locals 18
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getPaymentSourcesState()Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getSubscriptionsState()Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getEntitlementState()Lcom/discord/stores/StoreEntitlements$State;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getGuildSubscriptionState()Lcom/discord/stores/StorePremiumGuildSubscription$State;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual/range {p1 .. p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$StoreState;->getInvoicePreviewFetch()Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch;
|
|
|
|
move-result-object v4
|
|
|
|
instance-of v5, v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;
|
|
|
|
if-eqz v5, :cond_9
|
|
|
|
instance-of v5, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
if-eqz v5, :cond_9
|
|
|
|
instance-of v5, v2, Lcom/discord/stores/StoreEntitlements$State$Loaded;
|
|
|
|
if-eqz v5, :cond_9
|
|
|
|
instance-of v5, v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
if-eqz v5, :cond_9
|
|
|
|
instance-of v5, v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
if-eqz v5, :cond_9
|
|
|
|
check-cast v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;->getSubscriptions()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
const/4 v6, 0x1
|
|
|
|
const/4 v7, 0x0
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
move-object v8, v5
|
|
|
|
check-cast v8, Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelSubscription;->getType()Lcom/discord/models/domain/ModelSubscription$Type;
|
|
|
|
move-result-object v8
|
|
|
|
sget-object v9, Lcom/discord/models/domain/ModelSubscription$Type;->PREMIUM:Lcom/discord/models/domain/ModelSubscription$Type;
|
|
|
|
if-ne v8, v9, :cond_1
|
|
|
|
const/4 v8, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v8, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v8, :cond_0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 v5, 0x0
|
|
|
|
:goto_1
|
|
move-object v9, v5
|
|
|
|
check-cast v9, Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
if-eqz v9, :cond_7
|
|
|
|
invoke-virtual {v9}, Lcom/discord/models/domain/ModelSubscription;->getAdditionalPlans()Ljava/util/List;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_7
|
|
|
|
invoke-interface {v1}, Ljava/util/Collection;->isEmpty()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_3
|
|
|
|
goto :goto_4
|
|
|
|
:cond_3
|
|
invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_4
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v5
|
|
|
|
if-eqz v5, :cond_7
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v5
|
|
|
|
check-cast v5, Lcom/discord/models/domain/ModelSubscription$SubscriptionAdditionalPlan;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscription$SubscriptionAdditionalPlan;->getPlanId()J
|
|
|
|
move-result-wide v10
|
|
|
|
sget-object v8, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_MONTH:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v8}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
move-result-wide v12
|
|
|
|
cmp-long v8, v10, v12
|
|
|
|
if-eqz v8, :cond_6
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscription$SubscriptionAdditionalPlan;->getPlanId()J
|
|
|
|
move-result-wide v10
|
|
|
|
sget-object v5, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->PREMIUM_GUILD_YEAR:Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
invoke-virtual {v5}, Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;->getPlanId()J
|
|
|
|
move-result-wide v12
|
|
|
|
cmp-long v5, v10, v12
|
|
|
|
if-nez v5, :cond_5
|
|
|
|
goto :goto_2
|
|
|
|
:cond_5
|
|
const/4 v5, 0x0
|
|
|
|
goto :goto_3
|
|
|
|
:cond_6
|
|
:goto_2
|
|
const/4 v5, 0x1
|
|
|
|
:goto_3
|
|
if-eqz v5, :cond_4
|
|
|
|
const/16 v16, 0x1
|
|
|
|
goto :goto_5
|
|
|
|
:cond_7
|
|
:goto_4
|
|
const/16 v16, 0x0
|
|
|
|
:goto_5
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
check-cast v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;->getPaymentSources()Ljava/util/List;
|
|
|
|
move-result-object v10
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v13, 0x0
|
|
|
|
check-cast v2, Lcom/discord/stores/StoreEntitlements$State$Loaded;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/stores/StoreEntitlements$State$Loaded;->getOwnedEntitlements()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
const-wide v5, 0x73df54a4a020016L
|
|
|
|
invoke-static {v5, v6}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/List;
|
|
|
|
if-eqz v0, :cond_8
|
|
|
|
goto :goto_6
|
|
|
|
:cond_8
|
|
sget-object v0, Lt/q/o;->d:Lt/q/o;
|
|
|
|
:goto_6
|
|
move-object v14, v0
|
|
|
|
check-cast v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;->getPremiumGuildSubscriptionSlotMap()Ljava/util/Map;
|
|
|
|
move-result-object v15
|
|
|
|
check-cast v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;
|
|
|
|
invoke-virtual {v4}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Invoice;->getModelInvoicePreview()Lcom/discord/models/domain/billing/ModelInvoicePreview;
|
|
|
|
move-result-object v17
|
|
|
|
move-object v8, v1
|
|
|
|
invoke-direct/range {v8 .. v17}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;-><init>(Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;)V
|
|
|
|
goto :goto_8
|
|
|
|
:cond_9
|
|
instance-of v0, v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Failure;
|
|
|
|
if-nez v0, :cond_b
|
|
|
|
instance-of v0, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Failure;
|
|
|
|
if-nez v0, :cond_b
|
|
|
|
instance-of v0, v3, Lcom/discord/stores/StorePremiumGuildSubscription$State$Failure;
|
|
|
|
if-nez v0, :cond_b
|
|
|
|
instance-of v0, v4, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$InvoicePreviewFetch$Error;
|
|
|
|
if-eqz v0, :cond_a
|
|
|
|
goto :goto_7
|
|
|
|
:cond_a
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loading;
|
|
|
|
goto :goto_8
|
|
|
|
:cond_b
|
|
:goto_7
|
|
sget-object v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Failure;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Failure;
|
|
|
|
:goto_8
|
|
move-object/from16 v0, p0
|
|
|
|
invoke-virtual {v0, v1}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final markBusy()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x1
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1f3
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onCancelError()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getDialog()Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v0, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$CancelPremium;
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
new-instance v6, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$CancelPremium;
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-direct {v6, v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$CancelPremium;-><init>(Z)V
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1eb
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onChangePaymentSourceError()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
sget-object v5, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;->GENERIC:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1f3
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onDowngradeClicked()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
sget-object v6, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$DowngradePremium;->INSTANCE:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$DowngradePremium;
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1ef
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onResubscribeError()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
sget-object v5, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;->GENERIC:Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1f3
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private final onUpgradeClicked(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
.locals 15
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
move-object v0, v2
|
|
|
|
:cond_0
|
|
move-object v3, v0
|
|
|
|
check-cast v3, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v3, :cond_1
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
new-instance v8, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$UpgradePremium;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
move-object/from16 v9, p1
|
|
|
|
invoke-direct {v8, v9, v0, v1, v2}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog$UpgradePremium;-><init>(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/4 v11, 0x0
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/16 v13, 0x1ef
|
|
|
|
const/4 v14, 0x0
|
|
|
|
invoke-static/range {v3 .. v14}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
move-object v1, p0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
move-object v1, p0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final cancelSubscription()V
|
|
.locals 4
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
move-object v0, v2
|
|
|
|
:cond_0
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
sget-object v1, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v1, v0}, Lcom/discord/utilities/rest/RestAPI;->deleteSubscription(Ljava/lang/String;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {v0, p0, v2, v1, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$2;
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$cancelSubscription$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->a(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public final changePaymentSource(Lcom/discord/models/domain/ModelPaymentSource;)V
|
|
.locals 10
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
move-object v1, v0
|
|
|
|
:cond_0
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
sget-object v2, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v2}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
new-instance v9, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-virtual {p1}, Lcom/discord/models/domain/ModelPaymentSource;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
const/4 v7, 0x3
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v3, v9
|
|
|
|
invoke-direct/range {v3 .. v8}, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;-><init>(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
invoke-virtual {v2, v1, v9}, Lcom/discord/utilities/rest/RestAPI;->updateSubscription(Ljava/lang/String;Lcom/discord/restapi/RestAPIParams$UpdateSubscription;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-static {p1, v1, v2, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {p1, p0, v0, v1, v0}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$1;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$2;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$changePaymentSource$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
invoke-virtual {p1, v0, v1}, Lrx/Observable;->a(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
|
|
|
:cond_1
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "paymentSource"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final getLaunchPremiumTabStartTimeMs()J
|
|
.locals 2
|
|
|
|
iget-wide v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->launchPremiumTabStartTimeMs:J
|
|
|
|
return-wide v0
|
|
.end method
|
|
|
|
.method public final getRequestBuyPlanSubject()Lrx/Observable;
|
|
.locals 2
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Lrx/Observable<",
|
|
"Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
const-string v1, "requestBuyPlanSubject"
|
|
|
|
invoke-static {v0, v1}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStoreEntitlements()Lcom/discord/stores/StoreEntitlements;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeEntitlements:Lcom/discord/stores/StoreEntitlements;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStorePaymentsSources()Lcom/discord/stores/StorePaymentSources;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePaymentsSources:Lcom/discord/stores/StorePaymentSources;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStorePremiumGuildSubscription()Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final getStoreSubscriptions()Lcom/discord/stores/StoreSubscriptions;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final onDialogDismissClicked()V
|
|
.locals 13
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:cond_0
|
|
move-object v1, v0
|
|
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x0
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x0
|
|
|
|
const/4 v8, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
const/4 v10, 0x0
|
|
|
|
const/16 v11, 0x1ef
|
|
|
|
const/4 v12, 0x0
|
|
|
|
invoke-static/range {v1 .. v12}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->copy$default(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;Lcom/discord/models/domain/ModelSubscription;Ljava/util/List;ZLcom/discord/widgets/settings/premium/SettingsPremiumViewModel$SubscriptionError;Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$Dialog;Ljava/util/List;Ljava/util/Map;ZLcom/discord/models/domain/billing/ModelInvoicePreview;ILjava/lang/Object;)Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p0, v0}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onPlanRequested(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
move-object v1, v0
|
|
|
|
:cond_0
|
|
check-cast v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
move-result-object v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelSubscription;->getPlanType()Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;
|
|
|
|
move-result-object v0
|
|
|
|
:cond_1
|
|
if-nez v0, :cond_2
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->requestBuyPlanSubject:Lrx/subjects/PublishSubject;
|
|
|
|
invoke-virtual {v0, p1}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
if-ne p1, v0, :cond_3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
invoke-static {}, Lcom/discord/utilities/billing/PremiumUtilsKt;->getUPGRADE_ELIGIBILITY()Ljava/util/Map;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-ne v0, v1, :cond_4
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onUpgradeClicked(Lcom/discord/models/domain/ModelSubscriptionPlan$SubscriptionPlanType;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->onDowngradeClicked()V
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_6
|
|
const-string p1, "requestedPlanType"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final onRetryClicked()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->fetchData()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final resubscribe()V
|
|
.locals 10
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
instance-of v1, v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
move-object v0, v2
|
|
|
|
:cond_0
|
|
check-cast v0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$ViewState$Loaded;->getPremiumSubscription()Lcom/discord/models/domain/ModelSubscription;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getStatus()Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
move-result-object v1
|
|
|
|
sget-object v3, Lcom/discord/models/domain/ModelSubscription$Status;->CANCELED:Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
if-eq v1, v3, :cond_1
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
invoke-direct {p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->markBusy()V
|
|
|
|
sget-object v1, Lcom/discord/utilities/rest/RestAPI;->Companion:Lcom/discord/utilities/rest/RestAPI$Companion;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/rest/RestAPI$Companion;->getApi()Lcom/discord/utilities/rest/RestAPI;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelSubscription;->getId()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v9, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;
|
|
|
|
sget-object v3, Lcom/discord/models/domain/ModelSubscription$Status;->ACTIVE:Lcom/discord/models/domain/ModelSubscription$Status;
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelSubscription$Status;->getIntRepresentation()I
|
|
|
|
move-result v3
|
|
|
|
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
move-result-object v4
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const/4 v6, 0x0
|
|
|
|
const/4 v7, 0x6
|
|
|
|
const/4 v8, 0x0
|
|
|
|
move-object v3, v9
|
|
|
|
invoke-direct/range {v3 .. v8}, Lcom/discord/restapi/RestAPIParams$UpdateSubscription;-><init>(Ljava/lang/Integer;Ljava/lang/String;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
invoke-virtual {v1, v0, v9}, Lcom/discord/utilities/rest/RestAPI;->updateSubscription(Ljava/lang/String;Lcom/discord/restapi/RestAPIParams$UpdateSubscription;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-static {v0, v1, v3, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->restSubscribeOn$default(Lrx/Observable;ZILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x2
|
|
|
|
invoke-static {v0, p0, v2, v1, v2}, Lcom/discord/utilities/rx/ObservableExtensionsKt;->ui$default(Lrx/Observable;Lcom/discord/app/AppComponent;Lcom/discord/utilities/mg_recycler/MGRecyclerAdapterSimple;ILjava/lang/Object;)Lrx/Observable;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$1;
|
|
|
|
invoke-direct {v1, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$1;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
new-instance v2, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$2;
|
|
|
|
invoke-direct {v2, p0}, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel$resubscribe$2;-><init>(Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;)V
|
|
|
|
invoke-virtual {v0, v1, v2}, Lrx/Observable;->a(Lrx/functions/Action1;Lrx/functions/Action1;)Lrx/Subscription;
|
|
|
|
:cond_2
|
|
return-void
|
|
.end method
|
|
|
|
.method public final setLaunchPremiumTabStartTimeMs(J)V
|
|
.locals 0
|
|
|
|
iput-wide p1, p0, Lcom/discord/widgets/settings/premium/SettingsPremiumViewModel;->launchPremiumTabStartTimeMs:J
|
|
|
|
return-void
|
|
.end method
|