mirror of
https://github.com/mattermost/focalboard.git
synced 2024-12-24 13:43:12 +02:00
Personal Server - remove same function on disconnect as added on reconnect. (#4006)
* only dispatch initialLoad if me is defined, prevents recalling in loop * update to add/remove same function on reconnect
This commit is contained in:
parent
6ea67987e6
commit
667abb3a55
@ -141,11 +141,15 @@ const BoardPage = (props: Props): JSX.Element => {
|
||||
}
|
||||
}
|
||||
|
||||
const dispatchLoadAction = () => {
|
||||
dispatch(loadAction(match.params.boardId))
|
||||
}
|
||||
|
||||
Utils.log('useWEbsocket adding onChange handler')
|
||||
wsClient.addOnChange(incrementalBlockUpdate, 'block')
|
||||
wsClient.addOnChange(incrementalBoardUpdate, 'board')
|
||||
wsClient.addOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
||||
wsClient.addOnReconnect(() => dispatch(loadAction(match.params.boardId)))
|
||||
wsClient.addOnReconnect(dispatchLoadAction)
|
||||
|
||||
wsClient.setOnFollowBlock((_: WSClient, subscription: Subscription): void => {
|
||||
if (subscription.subscriberId === me?.id) {
|
||||
@ -163,7 +167,7 @@ const BoardPage = (props: Props): JSX.Element => {
|
||||
wsClient.removeOnChange(incrementalBlockUpdate, 'block')
|
||||
wsClient.removeOnChange(incrementalBoardUpdate, 'board')
|
||||
wsClient.removeOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
||||
wsClient.removeOnReconnect(() => dispatch(loadAction(match.params.boardId)))
|
||||
wsClient.removeOnReconnect(dispatchLoadAction)
|
||||
}
|
||||
}, [me?.id, activeBoardId])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user