Page MenuHomePhabricator

D10026.id33671.diff
No OneTemporary

D10026.id33671.diff

diff --git a/native/media/encrypted-image.react.js b/native/media/encrypted-image.react.js
--- a/native/media/encrypted-image.react.js
+++ b/native/media/encrypted-image.react.js
@@ -10,6 +10,7 @@
import { decryptBase64, decryptMedia } from './encryption-utils.js';
import LoadableImage from './loadable-image.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type BaseProps = {
@@ -34,7 +35,7 @@
} = props;
const mediaCache = React.useContext(MediaCacheContext);
- const [source, setSource] = React.useState(null);
+ const [source, setSource] = React.useState<?ImageSource>(null);
const connection = useSelector(connectionSelector(ashoatKeyserverID));
invariant(connection, 'keyserver missing from keyserverStore');
diff --git a/native/media/loadable-image.react.js b/native/media/loadable-image.react.js
--- a/native/media/loadable-image.react.js
+++ b/native/media/loadable-image.react.js
@@ -4,9 +4,9 @@
import { Image } from 'expo-image';
import * as React from 'react';
import { View, ActivityIndicator } from 'react-native';
-import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
import { useStyles } from '../themes/colors.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type Props = {
diff --git a/native/media/remote-image.react.js b/native/media/remote-image.react.js
--- a/native/media/remote-image.react.js
+++ b/native/media/remote-image.react.js
@@ -2,7 +2,6 @@
import invariant from 'invariant';
import * as React from 'react';
-import type { ImageSource } from 'react-native/Libraries/Image/ImageSource';
import { connectionSelector } from 'lib/selectors/keyserver-selectors.js';
import { type ConnectionStatus } from 'lib/types/socket-types.js';
@@ -10,6 +9,7 @@
import LoadableImage from './loadable-image.react.js';
import { useSelector } from '../redux/redux-utils.js';
+import type { ImageSource } from '../types/react-native.js';
import type { ImageStyle } from '../types/styles.js';
type BaseProps = {
diff --git a/native/types/react-native.js b/native/types/react-native.js
--- a/native/types/react-native.js
+++ b/native/types/react-native.js
@@ -2,6 +2,7 @@
import AnimatedInterpolation from 'react-native/Libraries/Animated/nodes/AnimatedInterpolation.js';
import type ReactNativeAnimatedValue from 'react-native/Libraries/Animated/nodes/AnimatedValue.js';
+import type { ImageSource } from 'react-native/Libraries/Image/ImageSource.js';
import type { ViewToken } from 'react-native/Libraries/Lists/ViewabilityHelper.js';
import type { ____ViewStyle_Internal } from 'react-native/Libraries/StyleSheet/StyleSheetTypes.js';
@@ -46,3 +47,5 @@
export type { AnimatedInterpolation };
export type ViewStyleObj = ____ViewStyle_Internal;
+
+export type { ImageSource };

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 10:59 PM (19 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2572132
Default Alt Text
D10026.id33671.diff (2 KB)

Event Timeline