Page MenuHomePhabricator

D7708.id26067.diff
No OneTemporary

D7708.id26067.diff

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

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)

Event Timeline