apkfuckery/com.discord/smali/com/discord/stores/StorePaymentSources.smali

406 lines
12 KiB
Smali

.class public final Lcom/discord/stores/StorePaymentSources;
.super Ljava/lang/Object;
.source "StorePaymentSources.kt"
# interfaces
.implements Lcom/discord/stores/DispatchHandler;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
}
.end annotation
# instance fields
.field public final dispatcher:Lcom/discord/stores/Dispatcher;
.field public isDirty:Z
.field public paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
.field public final paymentSourcesStateSubject:Lrx/subjects/BehaviorSubject;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lrx/subjects/BehaviorSubject<",
"Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;",
">;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>(Lcom/discord/stores/Dispatcher;)V
.locals 1
const-string v0, "dispatcher"
invoke-static {p1, v0}, Lc0/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Lcom/discord/stores/StorePaymentSources;->dispatcher:Lcom/discord/stores/Dispatcher;
sget-object p1, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Unfetched;->INSTANCE:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Unfetched;
iput-object p1, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
invoke-static {p1}, Lrx/subjects/BehaviorSubject;->i0(Ljava/lang/Object;)Lrx/subjects/BehaviorSubject;
move-result-object p1
iput-object p1, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesStateSubject:Lrx/subjects/BehaviorSubject;
return-void
.end method
.method public static final synthetic access$ensureDefaultPaymentSource(Lcom/discord/stores/StorePaymentSources;Ljava/util/List;)Ljava/util/List;
.locals 0
invoke-direct {p0, p1}, Lcom/discord/stores/StorePaymentSources;->ensureDefaultPaymentSource(Ljava/util/List;)Ljava/util/List;
move-result-object p0
return-object p0
.end method
.method public static final synthetic access$getDispatcher$p(Lcom/discord/stores/StorePaymentSources;)Lcom/discord/stores/Dispatcher;
.locals 0
iget-object p0, p0, Lcom/discord/stores/StorePaymentSources;->dispatcher:Lcom/discord/stores/Dispatcher;
return-object p0
.end method
.method public static final synthetic access$getPaymentSourcesState$p(Lcom/discord/stores/StorePaymentSources;)Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
.locals 0
iget-object p0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
return-object p0
.end method
.method public static final synthetic access$handlePaymentSourcesFetchFailure(Lcom/discord/stores/StorePaymentSources;)V
.locals 0
invoke-direct {p0}, Lcom/discord/stores/StorePaymentSources;->handlePaymentSourcesFetchFailure()V
return-void
.end method
.method public static final synthetic access$handlePaymentSourcesFetchStart(Lcom/discord/stores/StorePaymentSources;)V
.locals 0
invoke-direct {p0}, Lcom/discord/stores/StorePaymentSources;->handlePaymentSourcesFetchStart()V
return-void
.end method
.method public static final synthetic access$handlePaymentSourcesFetchSuccess(Lcom/discord/stores/StorePaymentSources;Ljava/util/List;)V
.locals 0
invoke-direct {p0, p1}, Lcom/discord/stores/StorePaymentSources;->handlePaymentSourcesFetchSuccess(Ljava/util/List;)V
return-void
.end method
.method public static final synthetic access$setPaymentSourcesState$p(Lcom/discord/stores/StorePaymentSources;Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;)V
.locals 0
iput-object p1, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
return-void
.end method
.method private final ensureDefaultPaymentSource(Ljava/util/List;)Ljava/util/List;
.locals 16
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Lcom/discord/models/domain/PaymentSourceRaw;",
">;)",
"Ljava/util/List<",
"Lcom/discord/models/domain/ModelPaymentSource;",
">;"
}
.end annotation
invoke-interface/range {p1 .. p1}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_0
sget-object v0, Lc0/i/l;->d:Lc0/i/l;
return-object v0
:cond_0
new-instance v0, Lcom/discord/stores/StorePaymentSources$ensureDefaultPaymentSource$$inlined$sortedBy$1;
invoke-direct {v0}, Lcom/discord/stores/StorePaymentSources$ensureDefaultPaymentSource$$inlined$sortedBy$1;-><init>()V
move-object/from16 v1, p1
invoke-static {v1, v0}, Lc0/i/f;->sortedWith(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
move-result-object v0
invoke-static {v0}, Lc0/i/f;->toMutableList(Ljava/util/Collection;)Ljava/util/List;
move-result-object v0
const/4 v1, 0x0
invoke-static {v0}, Lc0/i/f;->first(Ljava/util/List;)Ljava/lang/Object;
move-result-object v2
move-object v3, v2
check-cast v3, Lcom/discord/models/domain/PaymentSourceRaw;
const/4 v4, 0x0
const/4 v5, 0x0
const/4 v6, 0x0
const/4 v7, 0x0
const/4 v8, 0x1
const/4 v9, 0x0
const/4 v10, 0x0
const/4 v11, 0x0
const/4 v12, 0x0
const/4 v13, 0x0
const/16 v14, 0x3ef
const/4 v15, 0x0
invoke-static/range {v3 .. v15}, Lcom/discord/models/domain/PaymentSourceRaw;->copy$default(Lcom/discord/models/domain/PaymentSourceRaw;ILjava/lang/String;ZLcom/discord/models/domain/billing/ModelBillingAddress;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;IIILjava/lang/Object;)Lcom/discord/models/domain/PaymentSourceRaw;
move-result-object v2
move-object v3, v0
check-cast v3, Ljava/util/ArrayList;
invoke-virtual {v3, v1, v2}, Ljava/util/ArrayList;->set(ILjava/lang/Object;)Ljava/lang/Object;
new-instance v1, Ljava/util/ArrayList;
const/16 v2, 0xa
invoke-static {v0, v2}, Lf/h/a/f/e/n/f;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
move-result v2
invoke-direct {v1, v2}, Ljava/util/ArrayList;-><init>(I)V
invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v0
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lcom/discord/models/domain/PaymentSourceRaw;
sget-object v3, Lcom/discord/models/domain/ModelPaymentSource;->Companion:Lcom/discord/models/domain/ModelPaymentSource$Companion;
invoke-virtual {v3, v2}, Lcom/discord/models/domain/ModelPaymentSource$Companion;->wrap(Lcom/discord/models/domain/PaymentSourceRaw;)Lcom/discord/models/domain/ModelPaymentSource;
move-result-object v2
invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_1
return-object v1
.end method
.method private final handlePaymentSourcesFetchFailure()V
.locals 1
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
sget-object v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Failure;->INSTANCE:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Failure;
iput-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return-void
.end method
.method private final handlePaymentSourcesFetchStart()V
.locals 1
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
sget-object v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loading;->INSTANCE:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loading;
iput-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return-void
.end method
.method private final handlePaymentSourcesFetchSuccess(Ljava/util/List;)V
.locals 1
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"+",
"Lcom/discord/models/domain/ModelPaymentSource;",
">;)V"
}
.end annotation
new-instance v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;
invoke-direct {v0, p1}, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Loaded;-><init>(Ljava/util/List;)V
iput-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
const/4 p1, 0x1
iput-boolean p1, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return-void
.end method
# virtual methods
.method public final fetchPaymentSources()V
.locals 2
iget-object v0, p0, Lcom/discord/stores/StorePaymentSources;->dispatcher:Lcom/discord/stores/Dispatcher;
new-instance v1, Lcom/discord/stores/StorePaymentSources$fetchPaymentSources$1;
invoke-direct {v1, p0}, Lcom/discord/stores/StorePaymentSources$fetchPaymentSources$1;-><init>(Lcom/discord/stores/StorePaymentSources;)V
invoke-virtual {v0, v1}, Lcom/discord/stores/Dispatcher;->schedule(Lkotlin/jvm/functions/Function0;)V
return-void
.end method
.method public final getPaymentSources()Lrx/Observable;
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Lrx/Observable<",
"Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;",
">;"
}
.end annotation
iget-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesStateSubject:Lrx/subjects/BehaviorSubject;
invoke-virtual {v0}, Lrx/Observable;->q()Lrx/Observable;
move-result-object v0
const-string v1, "paymentSourcesStateSubje\u2026 .distinctUntilChanged()"
invoke-static {v0, v1}, Lc0/n/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
return-object v0
.end method
.method public final handlePreLogout()V
.locals 1
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
sget-object v0, Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Unfetched;->INSTANCE:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState$Unfetched;
iput-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return-void
.end method
.method public final handleUserPaymentSourcesUpdate()V
.locals 0
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
invoke-virtual {p0}, Lcom/discord/stores/StorePaymentSources;->fetchPaymentSources()V
return-void
.end method
.method public final isDirty()Z
.locals 1
iget-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return v0
.end method
.method public onDispatchEnded()V
.locals 2
.annotation runtime Lcom/discord/stores/StoreThread;
.end annotation
iget-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesStateSubject:Lrx/subjects/BehaviorSubject;
iget-object v1, p0, Lcom/discord/stores/StorePaymentSources;->paymentSourcesState:Lcom/discord/stores/StorePaymentSources$PaymentSourcesState;
invoke-virtual {v0, v1}, Lrx/subjects/BehaviorSubject;->onNext(Ljava/lang/Object;)V
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
:cond_0
return-void
.end method
.method public final setDirty(Z)V
.locals 0
iput-boolean p1, p0, Lcom/discord/stores/StorePaymentSources;->isDirty:Z
return-void
.end method