File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -235,10 +235,14 @@ synchronize = do
235235
236236setSelection :: forall m . MonadAff m => Maybe Date -> CompositeComponentM m Unit
237237setSelection selection = do
238+ setSelectionWithoutRaising selection
239+ H .raise $ SelectionChanged selection
240+
241+ setSelectionWithoutRaising :: forall m . MonadAff m => Maybe Date -> CompositeComponentM m Unit
242+ setSelectionWithoutRaising selection = do
238243 st <- H .get
239244 let targetDate = maybe st.targetDate (\d -> (year d) /\ (month d)) selection
240245 H .modify_ _ { selection = selection, targetDate = targetDate }
241- H .raise $ SelectionChanged selection
242246 synchronize
243247
244248-- ------------------------
@@ -318,7 +322,7 @@ embeddedHandleQuery = case _ of
318322 SetDisabled disabled a -> Just a <$ do
319323 H .modify_ _ { disabled = disabled }
320324 SetSelection selection a -> Just a <$ do
321- setSelection selection
325+ setSelectionWithoutRaising selection
322326
323327-- -------------------------
324328-- Embedded > handleMessage
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ embeddedHandleQuery = case _ of
234234 H .modify_ _ { disabled = disabled }
235235
236236 SetSelection selection a -> Just a <$ do
237- setSelection selection
237+ setSelectionWithoutRaising selection
238238
239239embeddedRender :: forall m . CompositeComponentRender m
240240embeddedRender s =
@@ -351,6 +351,10 @@ synchronize = do
351351
352352setSelection :: forall m . Maybe Time -> CompositeComponentM m Unit
353353setSelection selection = do
354- H .modify_ _ { selection = selection }
354+ setSelectionWithoutRaising selection
355355 H .raise $ SelectionChanged selection
356+
357+ setSelectionWithoutRaising :: forall m . Maybe Time -> CompositeComponentM m Unit
358+ setSelectionWithoutRaising selection = do
359+ H .modify_ _ { selection = selection }
356360 synchronize
You can’t perform that action at this time.
0 commit comments