72 lines
2.6 KiB
Java
72 lines
2.6 KiB
Java
package com.discord.widgets.voice.feedback;
|
|
|
|
import com.discord.app.AppViewModel;
|
|
import d0.z.d.m;
|
|
import kotlin.Unit;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
import rx.Observable;
|
|
import rx.subjects.PublishSubject;
|
|
/* compiled from: IssueDetailsFormViewModel.kt */
|
|
public final class IssueDetailsFormViewModel extends AppViewModel<Unit> {
|
|
private final PublishSubject<Event> eventSubject;
|
|
private final FeedbackSubmitter feedbackSubmitter;
|
|
private final PendingFeedback pendingFeedback;
|
|
private boolean submitted;
|
|
|
|
/* compiled from: IssueDetailsFormViewModel.kt */
|
|
public static abstract class Event {
|
|
|
|
/* compiled from: IssueDetailsFormViewModel.kt */
|
|
public static final class Close extends Event {
|
|
public static final Close INSTANCE = new Close();
|
|
|
|
private Close() {
|
|
super(null);
|
|
}
|
|
}
|
|
|
|
private Event() {
|
|
}
|
|
|
|
public /* synthetic */ Event(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
|
public IssueDetailsFormViewModel(PendingFeedback pendingFeedback, FeedbackSubmitter feedbackSubmitter) {
|
|
super(Unit.a);
|
|
m.checkNotNullParameter(pendingFeedback, "pendingFeedback");
|
|
m.checkNotNullParameter(feedbackSubmitter, "feedbackSubmitter");
|
|
this.pendingFeedback = pendingFeedback;
|
|
this.feedbackSubmitter = feedbackSubmitter;
|
|
PublishSubject<Event> k0 = PublishSubject.k0();
|
|
m.checkNotNullExpressionValue(k0, "PublishSubject.create()");
|
|
this.eventSubject = k0;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ IssueDetailsFormViewModel(PendingFeedback pendingFeedback, FeedbackSubmitter feedbackSubmitter, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(pendingFeedback, (i & 2) != 0 ? FeedbackSubmitterFactory.INSTANCE.create(pendingFeedback) : feedbackSubmitter);
|
|
}
|
|
|
|
public final Observable<Event> observeEvents() {
|
|
return this.eventSubject;
|
|
}
|
|
|
|
@Override // com.discord.app.AppViewModel, androidx.lifecycle.ViewModel
|
|
public void onCleared() {
|
|
super.onCleared();
|
|
submitForm(null);
|
|
}
|
|
|
|
public final void submitForm(String str) {
|
|
if (!this.submitted) {
|
|
this.submitted = true;
|
|
this.feedbackSubmitter.submit(str);
|
|
PublishSubject<Event> publishSubject = this.eventSubject;
|
|
publishSubject.j.onNext(Event.Close.INSTANCE);
|
|
}
|
|
}
|
|
}
|