diff --git a/lib/utils/action-utils.js b/lib/utils/action-utils.js --- a/lib/utils/action-utils.js +++ b/lib/utils/action-utils.js @@ -346,6 +346,7 @@ } export type ActionFunc = (fetchJSON: FetchJSON) => F; +export type BindSeverCall = (serverCall: ActionFunc) => F; type BindServerCallsParams = { dispatch: Dispatch, cookie: ?string, diff --git a/native/chat/settings/thread-settings-member-tooltip-modal.react.js b/native/chat/settings/thread-settings-member-tooltip-modal.react.js --- a/native/chat/settings/thread-settings-member-tooltip-modal.react.js +++ b/native/chat/settings/thread-settings-member-tooltip-modal.react.js @@ -14,7 +14,7 @@ } from 'lib/shared/thread-utils'; import { stringForUser } from 'lib/shared/user-utils'; import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types'; -import type { DispatchFunctions, ActionFunc } from 'lib/utils/action-utils'; +import type { DispatchFunctions, BindSeverCall } from 'lib/utils/action-utils'; import { createTooltip, @@ -32,7 +32,7 @@ function onRemoveUser( route: TooltipRoute<'ThreadSettingsMemberTooltipModal'>, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, ) { const { memberInfo, threadInfo } = route.params; const boundRemoveUsersFromThread = bindServerCall(removeUsersFromThread); @@ -59,7 +59,7 @@ function onToggleAdmin( route: TooltipRoute<'ThreadSettingsMemberTooltipModal'>, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, ) { const { memberInfo, threadInfo } = route.params; const isCurrentlyAdmin = memberIsAdmin(memberInfo, threadInfo); diff --git a/native/chat/sidebar-navigation.js b/native/chat/sidebar-navigation.js --- a/native/chat/sidebar-navigation.js +++ b/native/chat/sidebar-navigation.js @@ -5,7 +5,7 @@ import { createPendingSidebar } from 'lib/shared/thread-utils'; import type { ThreadInfo } from 'lib/types/thread-types'; -import type { DispatchFunctions, ActionFunc } from 'lib/utils/action-utils'; +import type { DispatchFunctions, BindSeverCall } from 'lib/utils/action-utils'; import type { InputState } from '../input/input-state'; import { getDefaultTextMessageRules } from '../markdown/rules.react'; @@ -45,7 +45,7 @@ function navigateToSidebar( route: TooltipRoute, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, inputState: ?InputState, navigation: AppNavigationProp, viewerID: ?string, diff --git a/native/chat/text-message-tooltip-modal.react.js b/native/chat/text-message-tooltip-modal.react.js --- a/native/chat/text-message-tooltip-modal.react.js +++ b/native/chat/text-message-tooltip-modal.react.js @@ -5,7 +5,7 @@ import * as React from 'react'; import { createMessageReply } from 'lib/shared/message-utils'; -import type { DispatchFunctions, ActionFunc } from 'lib/utils/action-utils'; +import type { DispatchFunctions, BindSeverCall } from 'lib/utils/action-utils'; import type { InputState } from '../input/input-state'; import { displayActionResultModal } from '../navigation/action-result-modal'; @@ -35,7 +35,7 @@ function onPressReply( route: TooltipRoute<'TextMessageTooltipModal'>, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, inputState: ?InputState, ) { invariant( diff --git a/native/navigation/tooltip.react.js b/native/navigation/tooltip.react.js --- a/native/navigation/tooltip.react.js +++ b/native/navigation/tooltip.react.js @@ -24,6 +24,7 @@ useDispatchActionPromise, type DispatchActionPromise, type ActionFunc, + type BindSeverCall, type DispatchFunctions, } from 'lib/utils/action-utils'; @@ -52,7 +53,7 @@ +onPress: ( route: TooltipRoute, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, inputState: ?InputState, navigation: AppNavigationProp, viewerID: ?string, diff --git a/native/profile/relationship-list-item-tooltip-modal.react.js b/native/profile/relationship-list-item-tooltip-modal.react.js --- a/native/profile/relationship-list-item-tooltip-modal.react.js +++ b/native/profile/relationship-list-item-tooltip-modal.react.js @@ -9,7 +9,7 @@ } from 'lib/actions/relationship-actions'; import { stringForUser } from 'lib/shared/user-utils'; import type { RelativeUserInfo } from 'lib/types/user-types'; -import type { DispatchFunctions, ActionFunc } from 'lib/utils/action-utils'; +import type { DispatchFunctions, BindSeverCall } from 'lib/utils/action-utils'; import PencilIcon from '../components/pencil-icon.react'; import type { AppNavigationProp } from '../navigation/app-navigator.react'; @@ -32,7 +32,7 @@ function onRemoveUser( props: OnRemoveUserProps, dispatchFunctions: DispatchFunctions, - bindServerCall: (serverCall: ActionFunc) => F, + bindServerCall: BindSeverCall, ) { const boundRemoveRelationships = bindServerCall(updateRelationships); const callRemoveRelationships = async () => {