Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33191014
D15396.1768538106.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
D15396.1768538106.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D15396: [web] remove invariant from `useThreadInfoForPossiblyPendingThread`
Attached
Detach File
Event Timeline
Log In to Comment