Page MenuHomePhorge

D15396.1768538106.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D15396.1768538106.diff

diff --git a/web/utils/thread-utils.js b/web/utils/thread-utils.js
--- a/web/utils/thread-utils.js
+++ b/web/utils/thread-utils.js
@@ -1,6 +1,5 @@
// @flow
-import invariant from 'invariant';
import * as React from 'react';
import { useLoggedInUserInfo } from 'lib/hooks/account-hooks.js';
@@ -42,9 +41,11 @@
const { isChatCreation, selectedUserInfos } = useInfosForPendingThread();
const loggedInUserInfo = useLoggedInUserInfo();
- invariant(loggedInUserInfo, 'loggedInUserInfo should be set');
const pendingThread = React.useMemo(() => {
+ if (!loggedInUserInfo) {
+ return null;
+ }
const protocol = getProtocolByName(selectedProtocol) ?? dmThreadProtocol;
return createPendingThread({
viewerID: loggedInUserInfo.id,
@@ -55,6 +56,9 @@
const newThreadID = 'pending/new_thread';
const pendingNewThread = React.useMemo(() => {
+ if (!loggedInUserInfo) {
+ return null;
+ }
const protocol = getProtocolByName(selectedProtocol) ?? dmThreadProtocol;
return {
...createPendingThread({

File Metadata

Mime Type
text/plain
Expires
Fri, Jan 16, 4:35 AM (13 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5941886
Default Alt Text
D15396.1768538106.diff (1 KB)

Event Timeline