Page MenuHomePhabricator

D11263.id38145.diff
No OneTemporary

D11263.id38145.diff

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
@@ -1,6 +1,6 @@
// @flow
-import { memberHasAdminPowers } from './thread-utils.js';
+import { roleIsAdminRole } from './thread-utils.js';
import { useENSNames } from '../hooks/ens-cache.js';
import type {
ThreadInfo,
@@ -36,7 +36,10 @@
// This hack only works as long as there is only one admin
// Linear task to revert this:
// https://linear.app/comm/issue/ENG-1707/revert-fix-getting-the-keyserver-admin-info
- const admin = community.members.find(memberHasAdminPowers);
+ const { roles, members } = community;
+ const admin = members.find(member =>
+ member.role ? roleIsAdminRole(roles[member.role]) : false,
+ );
const adminUserInfo = admin ? userInfos[admin.id] : undefined;
const [adminUserInfoWithENSName] = useENSNames([adminUserInfo]);
return adminUserInfoWithENSName;

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 6:55 AM (7 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2701872
Default Alt Text
D11263.id38145.diff (941 B)

Event Timeline