Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3270026
D8759.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8759.diff
View Options
diff --git a/lib/components/base-edit-thread-avatar-provider.react.js b/lib/components/base-edit-thread-avatar-provider.react.js
--- a/lib/components/base-edit-thread-avatar-provider.react.js
+++ b/lib/components/base-edit-thread-avatar-provider.react.js
@@ -26,7 +26,7 @@
selection: NativeMediaSelection,
threadID: string,
) => Promise<void>,
- +setThreadAvatar: (
+ +baseSetThreadAvatar: (
threadID: string,
avatarRequest: UpdateUserAvatarRequest,
) => Promise<void>,
@@ -113,7 +113,9 @@
],
);
- const setThreadAvatar = React.useCallback(
+ // NOTE: Do NOT consume `baseSetThreadAvatar` directly.
+ // Use platform-specific `[web/native]SetThreadAvatar` instead.
+ const baseSetThreadAvatar = React.useCallback(
async (threadID: string, avatarRequest: UpdateUserAvatarRequest) => {
const updateThreadRequest: UpdateThreadRequest = {
threadID,
@@ -135,9 +137,9 @@
() => ({
threadAvatarSaveInProgress,
updateImageThreadAvatar,
- setThreadAvatar,
+ baseSetThreadAvatar,
}),
- [threadAvatarSaveInProgress, updateImageThreadAvatar, setThreadAvatar],
+ [threadAvatarSaveInProgress, updateImageThreadAvatar, baseSetThreadAvatar],
);
return (
diff --git a/native/avatars/avatar-hooks.js b/native/avatars/avatar-hooks.js
--- a/native/avatars/avatar-hooks.js
+++ b/native/avatars/avatar-hooks.js
@@ -314,7 +314,7 @@
) => Promise<void> {
const editThreadAvatarContext = React.useContext(EditThreadAvatarContext);
invariant(editThreadAvatarContext, 'editThreadAvatarContext must be defined');
- const { setThreadAvatar } = editThreadAvatarContext;
+ const { baseSetThreadAvatar } = editThreadAvatarContext;
const nativeSetThreadAvatar = React.useCallback(
async (
@@ -322,13 +322,13 @@
avatarRequest: UpdateUserAvatarRequest,
): Promise<void> => {
try {
- await setThreadAvatar(threadID, avatarRequest);
+ await baseSetThreadAvatar(threadID, avatarRequest);
} catch (e) {
displayAvatarUpdateFailureAlert();
throw e;
}
},
- [setThreadAvatar],
+ [baseSetThreadAvatar],
);
return nativeSetThreadAvatar;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 4:19 AM (21 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2513170
Default Alt Text
D8759.diff (2 KB)
Attached To
Mode
D8759: [lib] Rename `setThreadAvatar` to `baseSetThreadAvatar` in `EditThreadAvatarProvider`
Attached
Detach File
Event Timeline
Log In to Comment