2020-01-02 21:43:52 +00:00
|
|
|
.class public final Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;
|
|
|
|
.super Le/a/b/c0;
|
|
|
|
.source "PremiumGuildViewModel.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState;,
|
|
|
|
Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event;,
|
|
|
|
Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;,
|
|
|
|
Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Factory;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Le/a/b/c0<",
|
|
|
|
"Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
2020-01-10 03:40:06 +00:00
|
|
|
.field public final clock:Lcom/discord/utilities/time/Clock;
|
2020-01-02 21:43:52 +00:00
|
|
|
|
|
|
|
.field public final eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Lrx/subjects/PublishSubject<",
|
|
|
|
"Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field public final storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
.field public final storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
2020-01-10 03:40:06 +00:00
|
|
|
.method public constructor <init>(Lcom/discord/stores/StorePremiumGuildSubscription;Lcom/discord/stores/StoreSubscriptions;Lcom/discord/utilities/time/Clock;Lrx/Observable;)V
|
2020-01-02 21:43:52 +00:00
|
|
|
.locals 10
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Lcom/discord/stores/StorePremiumGuildSubscription;",
|
|
|
|
"Lcom/discord/stores/StoreSubscriptions;",
|
2020-01-10 03:40:06 +00:00
|
|
|
"Lcom/discord/utilities/time/Clock;",
|
2020-01-02 21:43:52 +00:00
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
|
|
|
|
if-eqz p3, :cond_1
|
|
|
|
|
|
|
|
if-eqz p4, :cond_0
|
|
|
|
|
|
|
|
sget-object v1, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loading;
|
|
|
|
|
|
|
|
invoke-direct {p0, v1}, Le/a/b/c0;-><init>(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
iput-object p2, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
2020-01-10 03:40:06 +00:00
|
|
|
iput-object p3, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->clock:Lcom/discord/utilities/time/Clock;
|
2020-01-02 21:43:52 +00:00
|
|
|
|
|
|
|
invoke-static {}, Lrx/subjects/PublishSubject;->o()Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->fetchData()V
|
|
|
|
|
|
|
|
invoke-static {p4}, 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/servers/premiumguild/PremiumGuildViewModel;
|
|
|
|
|
|
|
|
const/4 v3, 0x0
|
|
|
|
|
|
|
|
const/4 v4, 0x0
|
|
|
|
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
const/4 v6, 0x0
|
|
|
|
|
|
|
|
new-instance v7, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$1;
|
|
|
|
|
|
|
|
invoke-direct {v7, p0}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$1;-><init>(Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;)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, "clock"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "storeSubscriptions"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const-string p1, "storePremiumGuildSubscription"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public static final synthetic access$handleStoreState(Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;)V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->handleStoreState(Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final fetchData()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->storePremiumGuildSubscription:Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePremiumGuildSubscription;->fetchUserGuildPremiumState()V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StoreSubscriptions;->fetchSubscriptions()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final handleStoreState(Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;)V
|
|
|
|
.locals 4
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;->getPremiumGuildSubscriptionState()Lcom/discord/stores/StorePremiumGuildSubscription$State;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;->getSubscriptionState()Lcom/discord/stores/StoreSubscriptions$SubscriptionsState;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
instance-of v2, v0, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loading;
|
|
|
|
|
|
|
|
if-nez v2, :cond_5
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loading;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
instance-of v2, v0, Lcom/discord/stores/StorePremiumGuildSubscription$State$Failure;
|
|
|
|
|
|
|
|
if-nez v2, :cond_4
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Failure;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
instance-of v2, v0, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/stores/StoreSubscriptions$SubscriptionsState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v2, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
if-nez v2, :cond_2
|
|
|
|
|
|
|
|
sget-object p1, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;->INSTANCE:Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
check-cast v0, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/stores/StorePremiumGuildSubscription$State$Loaded;->getPremiumGuildSubscriptionSlotMap()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
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-virtual {p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;->getMeUser()Lcom/discord/models/domain/ModelUser;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-virtual {p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$StoreState;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-direct {v2, v0, v1, v3, p1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;-><init>(Ljava/util/Map;Ljava/util/List;Lcom/discord/models/domain/ModelUser;Lcom/discord/models/domain/ModelGuild;)V
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
sget-object v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;->INSTANCE:Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
:goto_0
|
|
|
|
sget-object v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;->INSTANCE:Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Failure;
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
:goto_1
|
|
|
|
sget-object v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loading;->INSTANCE:Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loading;
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
invoke-virtual {p0, v2}, Le/a/b/c0;->updateViewState(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
2020-01-10 03:40:06 +00:00
|
|
|
.method public final getClock()Lcom/discord/utilities/time/Clock;
|
2020-01-02 21:43:52 +00:00
|
|
|
.locals 1
|
|
|
|
|
2020-01-10 03:40:06 +00:00
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->clock:Lcom/discord/utilities/time/Clock;
|
2020-01-02 21:43:52 +00:00
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getStorePremiumGuildSubscription()Lcom/discord/stores/StorePremiumGuildSubscription;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->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/servers/premiumguild/PremiumGuildViewModel;->storeSubscriptions:Lcom/discord/stores/StoreSubscriptions;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final giftClicked(Ljava/lang/String;)V
|
|
|
|
.locals 5
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
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/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
move-object v0, v1
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
check-cast v0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchWebPurchasePremiumGift;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
invoke-direct {v2, p1, v3, v4}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchWebPurchasePremiumGift;-><init>(Ljava/lang/String;J)V
|
|
|
|
|
|
|
|
invoke-virtual {v1, v2}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const-string p1, "section"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final observeEvents()Lrx/Observable;
|
|
|
|
.locals 2
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Lrx/Observable<",
|
|
|
|
"Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
const-string v1, "eventSubject"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Lt/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final retryClicked()V
|
|
|
|
.locals 0
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->fetchData()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final subscribeClicked(Ljava/lang/String;)V
|
|
|
|
.locals 12
|
|
|
|
.annotation build Landroidx/annotation/UiThread;
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_7
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Le/a/b/c0;->getViewState()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
instance-of v2, v1, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
|
|
|
|
move-object v1, v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
check-cast v1, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;
|
|
|
|
|
|
|
|
if-eqz v1, :cond_6
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;->getPremiumGuildSubscriptionSlotMap()Ljava/util/Map;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
new-instance v3, Ljava/util/LinkedHashMap;
|
|
|
|
|
|
|
|
invoke-direct {v3}, Ljava/util/LinkedHashMap;-><init>()V
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
|
|
|
|
move-result-object v2
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
:goto_0
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
|
|
|
|
move-result v4
|
|
|
|
|
|
|
|
const/4 v5, 0x1
|
|
|
|
|
|
|
|
if-eqz v4, :cond_4
|
|
|
|
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
check-cast v4, Ljava/util/Map$Entry;
|
|
|
|
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
check-cast v6, Lcom/discord/models/domain/ModelPremiumGuildSubscriptionSlot;
|
|
|
|
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelPremiumGuildSubscriptionSlot;->getCooldownExpiresAtTimestamp()J
|
|
|
|
|
|
|
|
move-result-wide v7
|
|
|
|
|
2020-01-10 03:40:06 +00:00
|
|
|
iget-object v9, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->clock:Lcom/discord/utilities/time/Clock;
|
2020-01-02 21:43:52 +00:00
|
|
|
|
2020-01-10 03:40:06 +00:00
|
|
|
invoke-interface {v9}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
|
2020-01-02 21:43:52 +00:00
|
|
|
|
|
|
|
move-result-wide v9
|
|
|
|
|
|
|
|
cmp-long v11, v7, v9
|
|
|
|
|
|
|
|
if-gez v11, :cond_3
|
|
|
|
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelPremiumGuildSubscriptionSlot;->getPremiumGuildSubscription()Lcom/discord/models/domain/ModelPremiumGuildSubscription;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
if-eqz v6, :cond_2
|
|
|
|
|
|
|
|
invoke-virtual {v6}, Lcom/discord/models/domain/ModelPremiumGuildSubscription;->getGuildId()J
|
|
|
|
|
|
|
|
move-result-wide v6
|
|
|
|
|
|
|
|
invoke-static {v6, v7}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
|
|
|
|
move-result-object v6
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
move-object v6, v0
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
if-nez v6, :cond_3
|
|
|
|
|
|
|
|
goto :goto_2
|
|
|
|
|
|
|
|
:cond_3
|
|
|
|
const/4 v5, 0x0
|
|
|
|
|
|
|
|
:goto_2
|
|
|
|
if-eqz v5, :cond_1
|
|
|
|
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v5
|
|
|
|
|
|
|
|
invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-virtual {v3, v5, v4}, Ljava/util/LinkedHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_4
|
|
|
|
invoke-interface {v3}, Ljava/util/Map;->isEmpty()Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
xor-int/2addr v0, v5
|
|
|
|
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchSubscriptionConfirmation;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v1
|
|
|
|
|
|
|
|
invoke-interface {v3}, Ljava/util/Map;->values()Ljava/util/Collection;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
invoke-static {v3}, Lt/q/l;->first(Ljava/lang/Iterable;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v3
|
|
|
|
|
|
|
|
check-cast v3, Lcom/discord/models/domain/ModelPremiumGuildSubscriptionSlot;
|
|
|
|
|
|
|
|
invoke-virtual {v3}, Lcom/discord/models/domain/ModelPremiumGuildSubscriptionSlot;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
invoke-direct {v0, v1, v2, v3, v4}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchSubscriptionConfirmation;-><init>(JJ)V
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
goto :goto_3
|
|
|
|
|
|
|
|
:cond_5
|
|
|
|
iget-object v0, p0, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel;->eventSubject:Lrx/subjects/PublishSubject;
|
|
|
|
|
|
|
|
new-instance v2, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchWebPurchaseSubscription;
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$ViewState$Loaded;->getGuild()Lcom/discord/models/domain/ModelGuild;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-virtual {v1}, Lcom/discord/models/domain/ModelGuild;->getId()J
|
|
|
|
|
|
|
|
move-result-wide v3
|
|
|
|
|
|
|
|
invoke-direct {v2, p1, v3, v4}, Lcom/discord/widgets/servers/premiumguild/PremiumGuildViewModel$Event$LaunchWebPurchaseSubscription;-><init>(Ljava/lang/String;J)V
|
|
|
|
|
|
|
|
invoke-virtual {v0, v2}, Lrx/subjects/PublishSubject;->onNext(Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
:cond_6
|
|
|
|
:goto_3
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_7
|
|
|
|
const-string p1, "section"
|
|
|
|
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|