Page MenuHomePhabricator

D13296.diff
No OneTemporary

D13296.diff

diff --git a/native/avatars/edit-thread-avatar.react.js b/native/avatars/edit-thread-avatar.react.js
--- a/native/avatars/edit-thread-avatar.react.js
+++ b/native/avatars/edit-thread-avatar.react.js
@@ -60,9 +60,9 @@
const navigateToCamera = React.useCallback(() => {
navigate<'ThreadAvatarCameraModal'>({
name: ThreadAvatarCameraModalRouteName,
- params: { threadID: threadInfo.id },
+ params: { threadInfo },
});
- }, [navigate, threadInfo.id]);
+ }, [navigate, threadInfo]);
const removeAvatar = React.useCallback(
() => nativeSetThreadAvatar(threadInfo.id, { type: 'remove' }),
diff --git a/native/media/thread-avatar-camera-modal.react.js b/native/media/thread-avatar-camera-modal.react.js
--- a/native/media/thread-avatar-camera-modal.react.js
+++ b/native/media/thread-avatar-camera-modal.react.js
@@ -5,6 +5,10 @@
import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js';
import type { PhotoCapture } from 'lib/types/media-types.js';
+import type {
+ RawThreadInfo,
+ ThreadInfo,
+} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { useNativeUpdateThreadImageAvatar } from '../avatars/avatar-hooks.js';
import CameraModal from '../media/camera-modal.react.js';
@@ -12,7 +16,7 @@
import type { NavigationRoute } from '../navigation/route-names.js';
export type ThreadAvatarCameraModalParams = {
- +threadID: string,
+ +threadInfo: ThreadInfo | RawThreadInfo,
};
type Props = {
@@ -22,7 +26,7 @@
function ThreadAvatarCameraModal(props: Props): React.Node {
const { navigation, route } = props;
- const { threadID } = route.params;
+ const { threadInfo } = route.params;
const editThreadAvatarContext = React.useContext(EditThreadAvatarContext);
invariant(editThreadAvatarContext, 'editThreadAvatarContext should be set');
@@ -30,8 +34,9 @@
const nativeUpdateThreadImageAvatar = useNativeUpdateThreadImageAvatar();
const sendPhoto = React.useCallback(
- (capture: PhotoCapture) => nativeUpdateThreadImageAvatar(capture, threadID),
- [threadID, nativeUpdateThreadImageAvatar],
+ (capture: PhotoCapture) =>
+ nativeUpdateThreadImageAvatar(capture, threadInfo.id),
+ [threadInfo.id, nativeUpdateThreadImageAvatar],
);
return <CameraModal handlePhotoCapture={sendPhoto} navigation={navigation} />;

File Metadata

Mime Type
text/plain
Expires
Wed, Jan 8, 11:14 PM (4 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2823980
Default Alt Text
D13296.diff (2 KB)

Event Timeline