Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3398836
D7708.id26067.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7708.id26067.diff
View Options
diff --git a/native/chat/compose-subchannel.react.js b/native/chat/compose-subchannel.react.js
--- a/native/chat/compose-subchannel.react.js
+++ b/native/chat/compose-subchannel.react.js
@@ -69,8 +69,7 @@
const tagInputRef = React.useRef();
const onUnknownErrorAlertAcknowledged = React.useCallback(() => {
setUsernameInputText('');
- invariant(tagInputRef.current, 'tagInput should be set');
- tagInputRef.current.focus();
+ tagInputRef.current?.focus();
}, []);
const waitingOnThreadIDRef = React.useRef<?string>();
diff --git a/native/chat/settings/add-users-modal.react.js b/native/chat/settings/add-users-modal.react.js
--- a/native/chat/settings/add-users-modal.react.js
+++ b/native/chat/settings/add-users-modal.react.js
@@ -1,6 +1,5 @@
// @flow
-import invariant from 'invariant';
import * as React from 'react';
import { View, Text, ActivityIndicator, Alert } from 'react-native';
@@ -62,8 +61,7 @@
const onUnknownErrorAlertAcknowledged = React.useCallback(() => {
setUsernameInputText('');
setUserInfoInputArray([]);
- invariant(tagInputRef.current, 'tagInput should be set');
- tagInputRef.current.focus();
+ tagInputRef.current?.focus();
}, []);
const { navigation } = props;
diff --git a/native/profile/relationship-list.react.js b/native/profile/relationship-list.react.js
--- a/native/profile/relationship-list.react.js
+++ b/native/profile/relationship-list.react.js
@@ -205,8 +205,7 @@
const onUnknownErrorAlertAcknowledged = React.useCallback(() => {
setCurrentTags([]);
setSearchInputText('');
- invariant(tagInputRef.current, 'tagInput should be set');
- tagInputRef.current.focus();
+ tagInputRef.current?.focus();
}, []);
const callUpdateRelationships = useServerCall(updateRelationships);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 12:42 AM (21 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2609495
Default Alt Text
D7708.id26067.diff (1 KB)
Attached To
Mode
D7708: [native] Don't crash if TagInput is unmounted before error received
Attached
Detach File
Event Timeline
Log In to Comment