From 4c86306bfd098ddf0ab16f7411bab83320985fee Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 8 Jul 2018 22:10:33 +0200 Subject: [PATCH] Fix NavBar-Highlighting --- src/Foundation.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 04656b02c..5a36a774e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -493,9 +493,9 @@ instance Yesod UniWorX where let highlight :: Route UniWorX -> Bool -- highlight last route in breadcrumbs, favorites taking priority highlight = let crumbs = mcons mcurrentRoute $ fst <$> parents - actFav = List.intersect (snd3 <$> favourites) crumbs - highRs = if null actFav then crumbs else actFav - in \r -> r `elem` highRs + navItems = map snd3 favourites ++ map (menuItemRoute . menuItem) menuTypes + highR = find (`elem` navItems) . uncurry (++) $ partition (`elem` map snd3 favourites) crumbs + in \r -> Just r == highR favouriteTerms :: [TermIdentifier] favouriteTerms = Set.toDescList $ foldMap (\(Course{..}, _, _) -> Set.singleton $ unTermKey courseTerm) favourites favouriteTerm :: TermIdentifier -> [(Course, Route UniWorX, [MenuTypes])]