@@ -351,14 +351,16 @@ dynamicAttributesToModifyAttributes = dynamicAttributesToModifyAttributesWithIni
351351dynamicAttributesToModifyAttributesWithInitial :: (Ord k, PostBuild t m) => Map k Text -> Dynamic t (Map k Text) -> m (Event t (Map k (Maybe Text)))
352352dynamicAttributesToModifyAttributesWithInitial attrs0 d = do
353353 postBuild <- getPostBuild
354− let modificationsNeeded = flip pushAlways (align postBuild $ updated d) $ \case
355− This () -> do
356− new <- sample $ current d
357− return $ diffMap attrs0 new
358− These () new -> return $ diffMap attrs0 new
359− That new -> do
360− old <- sample $ current d
361− return $ diffMap old new
354+ let modificationsNeeded = flip push (align postBuild $ updated d) $ \x -> do
355+ p <- case x of
356+ This () -> do
357+ new <- sample $ current d
358+ return $ diffMap attrs0 new
359+ These () new -> return $ diffMap attrs0 new
360+ That new -> do
361+ old <- sample $ current d
362+ return $ diffMap old new
363+ return $ if Map.null p then Nothing else Just p
362364 return modificationsNeeded
363365
364366--------------------------------------------------------------------------------