reload the tree when we receive a websocket notification about an unknown feed

This commit is contained in:
Athou
2025-02-14 14:05:09 +01:00
parent 903035ecfc
commit dc3e5476a1
2 changed files with 27 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import { setWebSocketConnected } from "app/server/slice"
import { type AppDispatch, useAppDispatch, useAppSelector } from "app/store"
import { incrementUnreadCount } from "app/tree/slice"
import { newFeedEntriesDiscovered } from "app/tree/thunks"
import { useEffect } from "react"
import WebsocketHeartbeatJs from "websocket-heartbeat-js"
@@ -9,7 +9,7 @@ const handleMessage = (dispatch: AppDispatch, message: string) => {
const type = parts[0]
if (type === "new-feed-entries") {
dispatch(
incrementUnreadCount({
newFeedEntriesDiscovered({
feedId: +parts[1],
amount: +parts[2],
})