mirror of
https://github.com/mattermost/focalboard.git
synced 2025-01-26 18:48:15 +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')
|
Utils.log('useWEbsocket adding onChange handler')
|
||||||
wsClient.addOnChange(incrementalBlockUpdate, 'block')
|
wsClient.addOnChange(incrementalBlockUpdate, 'block')
|
||||||
wsClient.addOnChange(incrementalBoardUpdate, 'board')
|
wsClient.addOnChange(incrementalBoardUpdate, 'board')
|
||||||
wsClient.addOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
wsClient.addOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
||||||
wsClient.addOnReconnect(() => dispatch(loadAction(match.params.boardId)))
|
wsClient.addOnReconnect(dispatchLoadAction)
|
||||||
|
|
||||||
wsClient.setOnFollowBlock((_: WSClient, subscription: Subscription): void => {
|
wsClient.setOnFollowBlock((_: WSClient, subscription: Subscription): void => {
|
||||||
if (subscription.subscriberId === me?.id) {
|
if (subscription.subscriberId === me?.id) {
|
||||||
@ -163,7 +167,7 @@ const BoardPage = (props: Props): JSX.Element => {
|
|||||||
wsClient.removeOnChange(incrementalBlockUpdate, 'block')
|
wsClient.removeOnChange(incrementalBlockUpdate, 'block')
|
||||||
wsClient.removeOnChange(incrementalBoardUpdate, 'board')
|
wsClient.removeOnChange(incrementalBoardUpdate, 'board')
|
||||||
wsClient.removeOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
wsClient.removeOnChange(incrementalBoardMemberUpdate, 'boardMembers')
|
||||||
wsClient.removeOnReconnect(() => dispatch(loadAction(match.params.boardId)))
|
wsClient.removeOnReconnect(dispatchLoadAction)
|
||||||
}
|
}
|
||||||
}, [me?.id, activeBoardId])
|
}, [me?.id, activeBoardId])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user