diff --git a/apps/xmtp.chat/src/components/ManageConversation.tsx b/apps/xmtp.chat/src/components/ManageConversation.tsx index 34c2018e..e0802f84 100644 --- a/apps/xmtp.chat/src/components/ManageConversation.tsx +++ b/apps/xmtp.chat/src/components/ManageConversation.tsx @@ -53,7 +53,7 @@ export const ManageConversation: React.FC = () => { const [addedMembers, setAddedMembers] = useState([]); const [removedMembers, setRemovedMembers] = useState([]); const [permissionsPolicy, setPermissionsPolicy] = - useState(GroupPermissionsOptions.AllMembers); + useState(GroupPermissionsOptions.Default); const [policySet, setPolicySet] = useState({ addAdminPolicy: PermissionPolicy.Admin, addMemberPolicy: PermissionPolicy.Admin, @@ -63,6 +63,7 @@ export const ManageConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Allow, updateGroupNamePolicy: PermissionPolicy.Allow, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Allow, + updateMessageExpirationPolicy: PermissionPolicy.Allow, }); const [updateConversationError, setUpdateConversationError] = useState< string | null @@ -76,7 +77,7 @@ export const ManageConversation: React.FC = () => { const [pinnedFrameUrl, setPinnedFrameUrl] = useState(""); const policyTooltip = useMemo(() => { - if (permissionsPolicy === GroupPermissionsOptions.AllMembers) { + if (permissionsPolicy === GroupPermissionsOptions.Default) { return "All members of the group can perform group actions"; } else if (permissionsPolicy === GroupPermissionsOptions.AdminOnly) { return "Only admins can perform group actions"; @@ -86,7 +87,7 @@ export const ManageConversation: React.FC = () => { useEffect(() => { if ( - permissionsPolicy === GroupPermissionsOptions.AllMembers || + permissionsPolicy === GroupPermissionsOptions.Default || permissionsPolicy === GroupPermissionsOptions.CustomPolicy ) { setPolicySet({ @@ -98,6 +99,7 @@ export const ManageConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Allow, updateGroupNamePolicy: PermissionPolicy.Allow, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Allow, + updateMessageExpirationPolicy: PermissionPolicy.Allow, }); } else { setPolicySet({ @@ -109,6 +111,7 @@ export const ManageConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Admin, updateGroupNamePolicy: PermissionPolicy.Admin, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Admin, + updateMessageExpirationPolicy: PermissionPolicy.Admin, }); } }, [permissionsPolicy]); @@ -161,7 +164,7 @@ export const ManageConversation: React.FC = () => { permissionsPolicy !== GroupPermissionsOptions.CustomPolicy ) { switch (permissionsPolicy) { - case GroupPermissionsOptions.AllMembers: { + case GroupPermissionsOptions.Default: { await conversation?.updatePermission( PermissionUpdateType.AddMember, PermissionPolicy.Deny, @@ -312,8 +315,8 @@ export const ManageConversation: React.FC = () => { const permissions = await conversation.permissions(); const policyType = permissions.policyType; switch (policyType) { - case GroupPermissionsOptions.AllMembers: - setPermissionsPolicy(GroupPermissionsOptions.AllMembers); + case GroupPermissionsOptions.Default: + setPermissionsPolicy(GroupPermissionsOptions.Default); setPolicySet({ addAdminPolicy: PermissionPolicy.Admin, addMemberPolicy: PermissionPolicy.Admin, @@ -323,6 +326,7 @@ export const ManageConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Allow, updateGroupNamePolicy: PermissionPolicy.Allow, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Allow, + updateMessageExpirationPolicy: PermissionPolicy.Allow, }); break; case GroupPermissionsOptions.AdminOnly: @@ -336,6 +340,7 @@ export const ManageConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Admin, updateGroupNamePolicy: PermissionPolicy.Admin, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Admin, + updateMessageExpirationPolicy: PermissionPolicy.Admin, }); break; case GroupPermissionsOptions.CustomPolicy: @@ -486,7 +491,7 @@ export const ManageConversation: React.FC = () => { ); }} data={[ - { value: "0", label: "All members" }, + { value: "0", label: "Default" }, { value: "1", label: "Admins only" }, { value: "2", label: "Custom policy" }, ]} diff --git a/apps/xmtp.chat/src/components/NewConversation.tsx b/apps/xmtp.chat/src/components/NewConversation.tsx index c07cc32b..ae93aea9 100644 --- a/apps/xmtp.chat/src/components/NewConversation.tsx +++ b/apps/xmtp.chat/src/components/NewConversation.tsx @@ -43,7 +43,7 @@ export const NewConversation: React.FC = () => { const [members, setMembers] = useState([]); const [isDmGroup, setIsDmGroup] = useState(false); const [permissionsPolicy, setPermissionsPolicy] = - useState(GroupPermissionsOptions.AllMembers); + useState(GroupPermissionsOptions.Default); const [policySet, setPolicySet] = useState({ addAdminPolicy: PermissionPolicy.Admin, addMemberPolicy: PermissionPolicy.Admin, @@ -53,6 +53,7 @@ export const NewConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Allow, updateGroupNamePolicy: PermissionPolicy.Allow, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Allow, + updateMessageExpirationPolicy: PermissionPolicy.Allow, }); const [createConversationError, setCreateConversationError] = useState< string | null @@ -64,7 +65,7 @@ export const NewConversation: React.FC = () => { const [pinnedFrameUrl, setPinnedFrameUrl] = useState(""); const policyTooltip = useMemo(() => { - if (permissionsPolicy === GroupPermissionsOptions.AllMembers) { + if (permissionsPolicy === GroupPermissionsOptions.Default) { return "All members of the group can perform group actions"; } else if (permissionsPolicy === GroupPermissionsOptions.AdminOnly) { return "Only admins can perform group actions"; @@ -74,7 +75,7 @@ export const NewConversation: React.FC = () => { useEffect(() => { if ( - permissionsPolicy === GroupPermissionsOptions.AllMembers || + permissionsPolicy === GroupPermissionsOptions.Default || permissionsPolicy === GroupPermissionsOptions.CustomPolicy ) { setPolicySet({ @@ -86,6 +87,7 @@ export const NewConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Allow, updateGroupNamePolicy: PermissionPolicy.Allow, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Allow, + updateMessageExpirationPolicy: PermissionPolicy.Allow, }); } else { setPolicySet({ @@ -97,6 +99,7 @@ export const NewConversation: React.FC = () => { updateGroupImageUrlSquarePolicy: PermissionPolicy.Admin, updateGroupNamePolicy: PermissionPolicy.Admin, updateGroupPinnedFrameUrlPolicy: PermissionPolicy.Admin, + updateMessageExpirationPolicy: PermissionPolicy.Admin, }); } }, [permissionsPolicy]); @@ -258,7 +261,7 @@ export const NewConversation: React.FC = () => { ); }} data={[ - { value: "0", label: "All members" }, + { value: "0", label: "Default" }, { value: "1", label: "Admins only" }, { value: "2", label: "Custom policy" }, ]}