2021-09-24 06:27:57 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import android.view.View;
|
|
|
|
import com.discord.widgets.guildscheduledevent.GuildScheduledEventSettingsViewModel;
|
|
|
|
import com.discord.widgets.guildscheduledevent.WidgetPreviewGuildScheduledEvent;
|
|
|
|
/* compiled from: WidgetGuildScheduledEventSettings.kt */
|
|
|
|
public final class WidgetGuildScheduledEventSettings$onViewBound$9 implements View.OnClickListener {
|
|
|
|
public final /* synthetic */ WidgetGuildScheduledEventSettings this$0;
|
|
|
|
|
|
|
|
public WidgetGuildScheduledEventSettings$onViewBound$9(WidgetGuildScheduledEventSettings widgetGuildScheduledEventSettings) {
|
|
|
|
this.this$0 = widgetGuildScheduledEventSettings;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
|
|
public final void onClick(View view) {
|
|
|
|
GuildScheduledEventSettingsViewModel.ViewState.Initialized access$getCurrentViewState$p = WidgetGuildScheduledEventSettings.access$getCurrentViewState$p(this.this$0);
|
|
|
|
if (access$getCurrentViewState$p == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (WidgetGuildScheduledEventSettings.access$getViewModel$p(this.this$0).hasStartTimeChanged(access$getCurrentViewState$p) && !WidgetGuildScheduledEventSettings.access$getViewModel$p(this.this$0).isDateInFuture(access$getCurrentViewState$p.getEventModel().getStartDate(), access$getCurrentViewState$p.getEventModel().getStartTime())) {
|
|
|
|
WidgetGuildScheduledEventSettings.access$showDateErrorToast(this.this$0, GuildScheduledEventSettingsViewModel.DateError.START_DATE_IN_PAST);
|
|
|
|
} else if (WidgetGuildScheduledEventSettings.access$getViewModel$p(this.this$0).hasEndTimeChanged(access$getCurrentViewState$p) && !WidgetGuildScheduledEventSettings.access$getViewModel$p(this.this$0).isDateInFuture(access$getCurrentViewState$p.getEventModel().getEndDate(), access$getCurrentViewState$p.getEventModel().getEndTime())) {
|
|
|
|
WidgetGuildScheduledEventSettings.access$showDateErrorToast(this.this$0, GuildScheduledEventSettingsViewModel.DateError.END_DATE_IN_PAST);
|
|
|
|
} else if (!WidgetGuildScheduledEventSettings.access$getViewModel$p(this.this$0).isStartDateBeforeEndDate(access$getCurrentViewState$p)) {
|
|
|
|
WidgetGuildScheduledEventSettings.access$showDateErrorToast(this.this$0, GuildScheduledEventSettingsViewModel.DateError.END_DATE_BEFORE_START_DATE);
|
|
|
|
} else {
|
|
|
|
WidgetPreviewGuildScheduledEvent.Companion companion = WidgetPreviewGuildScheduledEvent.Companion;
|
|
|
|
Context requireContext = this.this$0.requireContext();
|
|
|
|
GuildScheduledEventModel eventModel = access$getCurrentViewState$p.getEventModel();
|
|
|
|
Long access$getExistingGuildScheduledEventId$p = WidgetGuildScheduledEventSettings.access$getExistingGuildScheduledEventId$p(this.this$0);
|
2021-10-01 06:27:41 +00:00
|
|
|
companion.launch(requireContext, eventModel, access$getExistingGuildScheduledEventId$p != null ? new WidgetPreviewGuildScheduledEvent.Companion.ExistingEventData(access$getExistingGuildScheduledEventId$p.longValue(), WidgetPreviewGuildScheduledEvent.Companion.Action.EDIT_EVENT) : null, WidgetGuildScheduledEventSettings.access$getPreviewLauncher$p(this.this$0), true);
|
2021-09-24 06:27:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|