Page MenuHomePhorge

D5215.1765198815.diff
No OneTemporary

Size
5 KB
Referenced Files
None
Subscribers
None

D5215.1765198815.diff

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<F> = (fetchJSON: FetchJSON) => F;
+export type BindServerCall = <F>(serverCall: ActionFunc<F>) => 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, BindServerCall } from 'lib/utils/action-utils';
import {
createTooltip,
@@ -32,7 +32,7 @@
function onRemoveUser(
route: TooltipRoute<'ThreadSettingsMemberTooltipModal'>,
dispatchFunctions: DispatchFunctions,
- bindServerCall: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
) {
const { memberInfo, threadInfo } = route.params;
const boundRemoveUsersFromThread = bindServerCall(removeUsersFromThread);
@@ -59,7 +59,7 @@
function onToggleAdmin(
route: TooltipRoute<'ThreadSettingsMemberTooltipModal'>,
dispatchFunctions: DispatchFunctions,
- bindServerCall: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
) {
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, BindServerCall } from 'lib/utils/action-utils';
import type { InputState } from '../input/input-state';
import { getDefaultTextMessageRules } from '../markdown/rules.react';
@@ -45,7 +45,7 @@
function navigateToSidebar<RouteName: MessageTooltipRouteNames>(
route: TooltipRoute<RouteName>,
dispatchFunctions: DispatchFunctions,
- bindServerCall: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
inputState: ?InputState,
navigation: AppNavigationProp<RouteName>,
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, BindServerCall } 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: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
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 BindServerCall,
type DispatchFunctions,
} from 'lib/utils/action-utils';
@@ -52,7 +53,7 @@
+onPress: (
route: TooltipRoute<RouteName>,
dispatchFunctions: DispatchFunctions,
- bindServerCall: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
inputState: ?InputState,
navigation: AppNavigationProp<RouteName>,
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, BindServerCall } 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: <F>(serverCall: ActionFunc<F>) => F,
+ bindServerCall: BindServerCall,
) {
const boundRemoveRelationships = bindServerCall(updateRelationships);
const callRemoveRelationships = async () => {

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 8, 1:00 PM (6 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5848391
Default Alt Text
D5215.1765198815.diff (5 KB)

Event Timeline