Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32429429
D14830.1765354919.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14830.1765354919.diff
View Options
diff --git a/lib/tunnelbroker/use-confirm-peer-to-peer-message.js b/lib/tunnelbroker/use-confirm-peer-to-peer-message.js
--- a/lib/tunnelbroker/use-confirm-peer-to-peer-message.js
+++ b/lib/tunnelbroker/use-confirm-peer-to-peer-message.js
@@ -3,6 +3,7 @@
import * as React from 'react';
import { useTunnelbroker } from './tunnelbroker-context.js';
+import { isLoggedIn } from '../selectors/user-selectors.js';
import type { DispatchMetadata } from '../types/redux-types.js';
import {
type MessageProcessed,
@@ -11,17 +12,19 @@
import { getConfig } from '../utils/config.js';
import { getContentSigningKey } from '../utils/crypto-utils.js';
import { getMessageForException } from '../utils/errors.js';
+import { useSelector } from '../utils/redux-utils.js';
function useConfirmPeerToPeerMessage(): (
messageMetadata: ?DispatchMetadata,
) => Promise<void> {
const { sqliteAPI } = getConfig();
const { sendMessageToDevice } = useTunnelbroker();
+ const loggedIn = useSelector(isLoggedIn);
return React.useCallback(
async (messageMetadata: ?DispatchMetadata): Promise<void> => {
try {
- if (!messageMetadata) {
+ if (!loggedIn || !messageMetadata) {
return;
}
const { messageID, senderDeviceID } = messageMetadata;
@@ -50,7 +53,7 @@
);
}
},
- [sendMessageToDevice, sqliteAPI],
+ [loggedIn, sendMessageToDevice, sqliteAPI],
);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 10, 8:21 AM (15 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5862446
Default Alt Text
D14830.1765354919.diff (1 KB)
Attached To
Mode
D14830: [lib] Stop confirming P2P messages when logout is started
Attached
Detach File
Event Timeline
Log In to Comment