refactor: hlint
This commit is contained in:
parent
7896c0bb16
commit
ebe676d39d
@ -48,12 +48,12 @@ postCFavouriteR tid ssh csh = void $ do
|
|||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
-- Nothing means blacklist
|
-- Nothing means blacklist
|
||||||
-- should never return FavouriteCurrent
|
-- should never return FavouriteCurrent
|
||||||
newReason <- storedFavouriteReason tid ssh csh muid >>= pure . \case
|
newReason <- storedFavouriteReason tid ssh csh muid <&> (\case
|
||||||
-- Maybe (Maybe reason, blacklist)
|
-- Maybe (Maybe reason, blacklist)
|
||||||
Nothing -> Just FavouriteManual
|
Nothing -> Just FavouriteManual
|
||||||
Just (_reason, True) -> Just FavouriteVisited
|
Just (_reason, True) -> Just FavouriteVisited
|
||||||
Just (Just FavouriteManual, False) -> Nothing
|
Just (Just FavouriteManual, False) -> Nothing
|
||||||
Just (_reason, False) -> Just FavouriteManual
|
Just (_reason, False) -> Just FavouriteManual)
|
||||||
-- change stored reason in DB
|
-- change stored reason in DB
|
||||||
case newReason of
|
case newReason of
|
||||||
(Just reason) -> do
|
(Just reason) -> do
|
||||||
|
|||||||
@ -47,7 +47,7 @@ instance Button UniWorX CourseFavouriteToggleButton where
|
|||||||
-- inspired by examAutoOccurrenceIgnoreRoomsForm
|
-- inspired by examAutoOccurrenceIgnoreRoomsForm
|
||||||
courseFavouriteToggleForm :: Maybe FavouriteReason -> Form ()
|
courseFavouriteToggleForm :: Maybe FavouriteReason -> Form ()
|
||||||
courseFavouriteToggleForm currentReason html
|
courseFavouriteToggleForm currentReason html
|
||||||
= over _1 (fmap $ const ()) <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html
|
= over _1 void <$> identifyForm FIDCourseFavouriteToggle (buttonForm' [btn]) html
|
||||||
where
|
where
|
||||||
btn :: CourseFavouriteToggleButton
|
btn :: CourseFavouriteToggleButton
|
||||||
btn = case currentReason of
|
btn = case currentReason of
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user