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 : Int -> Bool -> (Status -> Status) -> Model -> Model
|
||||||
updateTimelinesWithBoolFlag statusId flag statusUpdater model =
|
updateTimelinesWithBoolFlag statusId flag statusUpdater model =
|
||||||
let
|
let
|
||||||
update flag status =
|
update status =
|
||||||
if (Mastodon.Helper.extractReblog status).id == statusId then
|
if (Mastodon.Helper.extractReblog status).id == statusId then
|
||||||
statusUpdater status
|
statusUpdater status
|
||||||
else
|
else
|
||||||
status
|
status
|
||||||
in
|
in
|
||||||
{ model
|
{ model
|
||||||
| userTimeline = List.map (update flag) model.userTimeline
|
| userTimeline = List.map update model.userTimeline
|
||||||
, accountTimeline = List.map (update flag) model.accountTimeline
|
, accountTimeline = List.map update model.accountTimeline
|
||||||
, localTimeline = List.map (update flag) model.localTimeline
|
, localTimeline = List.map update model.localTimeline
|
||||||
, globalTimeline = List.map (update flag) model.globalTimeline
|
, 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