Reflect status events in thread view. (#123)
This commit is contained in:
parent
edf64977f2
commit
3b67a20909
@ -124,17 +124,30 @@ toStatusRequestBody draft =
|
||||
updateTimelinesWithBoolFlag : Int -> Bool -> (Status -> Status) -> Model -> Model
|
||||
updateTimelinesWithBoolFlag statusId flag statusUpdater model =
|
||||
let
|
||||
update flag status =
|
||||
update status =
|
||||
if (Mastodon.Helper.extractReblog status).id == statusId then
|
||||
statusUpdater status
|
||||
else
|
||||
status
|
||||
in
|
||||
{ model
|
||||
| userTimeline = List.map (update flag) model.userTimeline
|
||||
, accountTimeline = List.map (update flag) model.accountTimeline
|
||||
, localTimeline = List.map (update flag) model.localTimeline
|
||||
, globalTimeline = List.map (update flag) model.globalTimeline
|
||||
| userTimeline = List.map update model.userTimeline
|
||||
, accountTimeline = List.map update model.accountTimeline
|
||||
, localTimeline = List.map update model.localTimeline
|
||||
, globalTimeline = List.map update model.globalTimeline
|
||||
, currentView =
|
||||
case model.currentView of
|
||||
ThreadView thread ->
|
||||
ThreadView
|
||||
{ status = update thread.status
|
||||
, context =
|
||||
{ ancestors = List.map update thread.context.ancestors
|
||||
, descendants = List.map update thread.context.descendants
|
||||
}
|
||||
}
|
||||
|
||||
currentView ->
|
||||
currentView
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user