Page MenuHomePhabricator

D6420.diff
No OneTemporary

D6420.diff

diff --git a/lib/hooks/ens-cache.js b/lib/hooks/ens-cache.js
--- a/lib/hooks/ens-cache.js
+++ b/lib/hooks/ens-cache.js
@@ -5,11 +5,9 @@
import { ENSCacheContext } from '../components/ens-cache-provider.react';
import { userIdentifiedByETHAddress } from '../shared/account-utils';
import { stringForUser } from '../shared/user-utils';
-import type { RelativeMemberInfo } from '../types/thread-types';
-import type { RelativeUserInfo } from '../types/user-types';
function useStringForUser(
- user: ?(RelativeUserInfo | RelativeMemberInfo),
+ user: ?{ +username?: ?string, +isViewer?: ?boolean, ... },
): ?string {
const ethAddress = React.useMemo(() => {
if (
diff --git a/lib/shared/user-utils.js b/lib/shared/user-utils.js
--- a/lib/shared/user-utils.js
+++ b/lib/shared/user-utils.js
@@ -5,17 +5,16 @@
import type {
ServerThreadInfo,
RawThreadInfo,
- RelativeMemberInfo,
ThreadInfo,
} from '../types/thread-types';
-import type {
- RelativeUserInfo,
- UserInfo,
- UserInfos,
-} from '../types/user-types';
+import type { UserInfo, UserInfos } from '../types/user-types';
import { memberHasAdminPowers } from './thread-utils';
-function stringForUser(user: RelativeUserInfo | RelativeMemberInfo): string {
+function stringForUser(user: {
+ +username?: ?string,
+ +isViewer?: ?boolean,
+ ...
+}): string {
if (user.isViewer) {
return 'you';
}
@@ -23,9 +22,7 @@
return stringForUserExplicit(user);
}
-function stringForUserExplicit(
- user: RelativeUserInfo | RelativeMemberInfo,
-): string {
+function stringForUserExplicit(user: { +username: ?string, ... }): string {
if (user.username) {
return user.username;
} else {

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 7:48 PM (20 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2688898
Default Alt Text
D6420.diff (1 KB)

Event Timeline