month-view: only update selection if there's a start date

We can potentially not have an end date set, but there's always
a start date. If there isn't, it means the user clicked from
outside of month view, or at an invalid cell, in which cases we
shouldn't display the quick add popover anyway.
This commit is contained in:
Georges Basile Stavracas Neto
2017-10-07 11:20:23 -03:00
parent a0c224a0d5
commit ff9c663c8c
+2 -2
View File
@@ -232,7 +232,7 @@ emit_create_event (GcalMonthView *self)
GCAL_ENTRY;
if (!self->end_mark_cell)
if (!self->start_mark_cell || !self->end_mark_cell)
GCAL_RETURN (FALSE);
should_clear_end = FALSE;
@@ -534,7 +534,7 @@ update_month_cells (GcalMonthView *self)
selection_start = self->start_mark_cell;
selection_end = self->end_mark_cell;
if (selection_start || selection_end)
if (selection_start)
{
if (!selection_end)
selection_end = selection_start;