Page MenuHomePhabricator

D13792.id45392.diff
No OneTemporary

D13792.id45392.diff

diff --git a/lib/tunnelbroker/peer-to-peer-message-handler.js b/lib/tunnelbroker/peer-to-peer-message-handler.js
--- a/lib/tunnelbroker/peer-to-peer-message-handler.js
+++ b/lib/tunnelbroker/peer-to-peer-message-handler.js
@@ -31,7 +31,7 @@
function PeerToPeerMessageHandler(props: Props): React.Node {
const { socketSend, getSessionCounter, doesSocketExist } = props;
- const { addListener, removeListener } = useTunnelbroker();
+ const { addListener, removeListener, socketState } = useTunnelbroker();
const peerToPeerMessageHandler = usePeerToPeerMessageHandler();
const handleOlmMessageToDevice = useHandleOlmMessageToDevice();
@@ -180,12 +180,16 @@
const processingInputMessagesStarted = React.useRef(false);
React.useEffect(() => {
- if (!viewerID || processingInputMessagesStarted.current) {
+ if (
+ !viewerID ||
+ processingInputMessagesStarted.current ||
+ !socketState.isAuthorized
+ ) {
return;
}
processingInputMessagesStarted.current = true;
void processPersistedInboundMessages();
- }, [processPersistedInboundMessages, viewerID]);
+ }, [processPersistedInboundMessages, viewerID, socketState]);
}
export { PeerToPeerMessageHandler };

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 31, 2:30 PM (20 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2391736
Default Alt Text
D13792.id45392.diff (1 KB)

Event Timeline