Use currentView to subscribe contextually to WS

Closes #74
This commit is contained in:
Vincent Jousse 2017-05-03 21:58:32 +02:00
parent 59c1050e10
commit bff92549a2

View File

@ -975,18 +975,20 @@ subscriptions model =
Mastodon.WebSocket.UserStream
NewWebsocketUserMessage
]
++ (if model.useGlobalTimeline then
++ (if model.currentView == GlobalTimelineView then
[ Mastodon.WebSocket.subscribeToWebSockets
client
Mastodon.WebSocket.GlobalPublicStream
NewWebsocketGlobalMessage
]
else
else if model.currentView == LocalTimelineView then
[ Mastodon.WebSocket.subscribeToWebSockets
client
Mastodon.WebSocket.LocalPublicStream
NewWebsocketLocalMessage
]
else
[]
)
in
Sub.batch <|