Fixed #166: Limit number of accounts in notifications.
This commit is contained in:
parent
4d8757ad7c
commit
2d0d5cd7b9
@ -113,7 +113,7 @@ addNotificationToAggregates notification aggregates =
|
|||||||
in
|
in
|
||||||
{-
|
{-
|
||||||
If we did no modification to the old aggregates it's
|
If we did no modification to the old aggregates it's
|
||||||
because we didn't found any match. So me have to create
|
because we didn't found any match. So we have to create
|
||||||
a new aggregate
|
a new aggregate
|
||||||
-}
|
-}
|
||||||
if newAggregates == aggregates then
|
if newAggregates == aggregates then
|
||||||
|
@ -57,15 +57,33 @@ filterNotifications filter notifications =
|
|||||||
|
|
||||||
notificationHeading : List Account -> String -> String -> Html Msg
|
notificationHeading : List Account -> String -> String -> Html Msg
|
||||||
notificationHeading accounts str iconType =
|
notificationHeading accounts str iconType =
|
||||||
div [ class "status-info" ]
|
let
|
||||||
[ div [ class "avatars" ] <| List.map (Common.accountAvatarLink False) accounts
|
( firstAccounts, finalStr ) =
|
||||||
, p [ class "status-info-text" ] <|
|
case accounts of
|
||||||
List.intersperse (text " ")
|
[ a1 ] ->
|
||||||
[ Common.icon iconType
|
( [ a1 ], str )
|
||||||
, span [] <| List.intersperse (text ", ") (List.map (Common.accountLink False) accounts)
|
|
||||||
, text str
|
[ a1, a2 ] ->
|
||||||
]
|
( [ a1, a2 ], str )
|
||||||
]
|
|
||||||
|
[ a1, a2, a3 ] ->
|
||||||
|
( [ a1, a2, a3 ], str )
|
||||||
|
|
||||||
|
a1 :: a2 :: a3 :: xs ->
|
||||||
|
( [ a1, a2, a3 ], " and " ++ (toString <| List.length xs) ++ " others " ++ str )
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
( [], "" )
|
||||||
|
in
|
||||||
|
div [ class "status-info" ]
|
||||||
|
[ div [ class "avatars" ] <| List.map (Common.accountAvatarLink False) accounts
|
||||||
|
, p [ class "status-info-text" ] <|
|
||||||
|
List.intersperse (text " ")
|
||||||
|
[ Common.icon iconType
|
||||||
|
, span [] <| List.intersperse (text ", ") (List.map (Common.accountLink False) firstAccounts)
|
||||||
|
, text finalStr
|
||||||
|
]
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
notificationStatusView : ( String, CurrentUser, Status, NotificationAggregate ) -> Html Msg
|
notificationStatusView : ( String, CurrentUser, Status, NotificationAggregate ) -> Html Msg
|
||||||
@ -102,7 +120,7 @@ notificationFollowView currentUser { accounts } =
|
|||||||
in
|
in
|
||||||
div [ class "notification follow" ]
|
div [ class "notification follow" ]
|
||||||
[ notificationHeading accounts "started following you" "user"
|
[ notificationHeading accounts "started following you" "user"
|
||||||
, div [ class "" ] <| List.map profileView accounts
|
, div [ class "" ] <| List.map profileView (List.take 3 accounts)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user