diff --git a/lib/hooks/relationship-prompt.js b/lib/hooks/relationship-prompt.js --- a/lib/hooks/relationship-prompt.js +++ b/lib/hooks/relationship-prompt.js @@ -9,10 +9,8 @@ } from '../actions/relationship-actions.js'; import { getSingleOtherUser } from '../shared/thread-utils.js'; import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; -import { - type RelationshipAction, - relationshipActions, -} from '../types/relationship-types.js'; +import { relationshipActions } from '../types/relationship-types.js'; +import type { TraditionalRelationshipAction } from '../types/relationship-types.js'; import type { UserInfo } from '../types/user-types.js'; import { useLegacyAshoatKeyserverCall } from '../utils/action-utils.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; @@ -70,7 +68,7 @@ serverUpdateRelationships, ); const updateRelationship = React.useCallback( - async (action: RelationshipAction) => { + async (action: TraditionalRelationshipAction) => { try { invariant(otherUserID, 'Other user info id should be present'); return await callUpdateRelationships({ @@ -87,7 +85,7 @@ const dispatchActionPromise = useDispatchActionPromise(); const onButtonPress = React.useCallback( - (action: RelationshipAction) => { + (action: TraditionalRelationshipAction) => { void dispatchActionPromise( updateRelationshipsActionTypes, updateRelationship(action), diff --git a/lib/shared/relationship-utils.js b/lib/shared/relationship-utils.js --- a/lib/shared/relationship-utils.js +++ b/lib/shared/relationship-utils.js @@ -8,7 +8,7 @@ userRelationshipStatus, relationshipButtons, relationshipActions, - type RelationshipAction, + type TraditionalRelationshipAction, } from '../types/relationship-types.js'; import type { UserInfo } from '../types/user-types.js'; @@ -67,7 +67,7 @@ // eslint-disable-next-line consistent-return function getRelationshipDispatchAction( relationshipButton: RelationshipButton, -): RelationshipAction { +): TraditionalRelationshipAction { if (relationshipButton === relationshipButtons.BLOCK) { return relationshipActions.BLOCK; } else if ( diff --git a/lib/types/relationship-types.js b/lib/types/relationship-types.js --- a/lib/types/relationship-types.js +++ b/lib/types/relationship-types.js @@ -68,7 +68,7 @@ export type RelationshipButton = $Values; export type TraditionalRelationshipRequest = { - +action: RelationshipAction, + +action: TraditionalRelationshipAction, +userIDs: $ReadOnlyArray, }; diff --git a/native/chat/settings/thread-settings-edit-relationship.react.js b/native/chat/settings/thread-settings-edit-relationship.react.js --- a/native/chat/settings/thread-settings-edit-relationship.react.js +++ b/native/chat/settings/thread-settings-edit-relationship.react.js @@ -16,7 +16,7 @@ import { getSingleOtherUser } from 'lib/shared/thread-utils.js'; import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { - type RelationshipAction, + type TraditionalRelationshipAction, type RelationshipButton, } from 'lib/types/relationship-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; @@ -53,7 +53,7 @@ serverUpdateRelationships, ); const updateRelationship = React.useCallback( - async (action: RelationshipAction) => { + async (action: TraditionalRelationshipAction) => { try { return await callUpdateRelationships({ action, diff --git a/native/profile/relationship-list-item.react.js b/native/profile/relationship-list-item.react.js --- a/native/profile/relationship-list-item.react.js +++ b/native/profile/relationship-list-item.react.js @@ -12,7 +12,7 @@ import type { LoadingStatus } from 'lib/types/loading-types.js'; import type { ReactRef } from 'lib/types/react-types.js'; import { - type RelationshipAction, + type TraditionalRelationshipAction, type RelationshipErrors, userRelationshipStatus, relationshipActions, @@ -292,7 +292,7 @@ this.onPressUpdateFriendship(relationshipActions.UNFRIEND); }; - onPressUpdateFriendship(action: RelationshipAction) { + onPressUpdateFriendship(action: TraditionalRelationshipAction) { const { id } = this.props.userInfo; const customKeyName = `${updateRelationshipsActionTypes.started}:${id}`; void this.props.dispatchActionPromise( @@ -303,7 +303,7 @@ } async updateFriendship( - action: RelationshipAction, + action: TraditionalRelationshipAction, ): Promise { try { return await this.props.updateRelationships({ diff --git a/web/settings/relationship/add-users-list-modal.react.js b/web/settings/relationship/add-users-list-modal.react.js --- a/web/settings/relationship/add-users-list-modal.react.js +++ b/web/settings/relationship/add-users-list-modal.react.js @@ -10,7 +10,7 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import type { UserRelationshipStatus, - RelationshipAction, + TraditionalRelationshipAction, } from 'lib/types/relationship-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -64,7 +64,7 @@ +excludedStatuses: $ReadOnlySet, +confirmButtonContent: React.Node, +confirmButtonColor?: ButtonColor, - +relationshipAction: RelationshipAction, + +relationshipAction: TraditionalRelationshipAction, }; function AddUsersListModal(props: Props): React.Node {