Files
mattermost-mobile/patches/react-native-fast-image+8.6.3.patch
2022-11-08 22:49:39 +02:00

91 lines
3.6 KiB
Diff

diff --git a/node_modules/react-native-fast-image/RNFastImage.podspec b/node_modules/react-native-fast-image/RNFastImage.podspec
index db0fada..47dbd5b 100644
--- a/node_modules/react-native-fast-image/RNFastImage.podspec
+++ b/node_modules/react-native-fast-image/RNFastImage.podspec
@@ -16,6 +16,6 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m}"
s.dependency 'React-Core'
- s.dependency 'SDWebImage', '~> 5.11.1'
+ s.dependency 'SDWebImage', '~> 5.12.3'
s.dependency 'SDWebImageWebPCoder', '~> 0.8.4'
end
diff --git a/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageCookieJar.java b/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageCookieJar.java
new file mode 100644
index 0000000..a302394
--- /dev/null
+++ b/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageCookieJar.java
@@ -0,0 +1,45 @@
+package com.dylanvann.fastimage;
+
+import android.webkit.CookieManager;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import okhttp3.Cookie;
+import okhttp3.CookieJar;
+import okhttp3.HttpUrl;
+
+public class FastImageCookieJar implements CookieJar {
+ private CookieManager cookieManager;
+
+ private CookieManager getCookieManager() {
+ if (cookieManager == null) {
+ cookieManager = CookieManager.getInstance();
+ }
+
+ return cookieManager;
+ }
+
+ @Override
+ public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
+ // Do nothing
+ }
+
+ @Override
+ public List<Cookie> loadForRequest(HttpUrl url) {
+ String cookie = getCookieManager().getCookie(url.toString());
+
+ if (cookie == null || cookie.isEmpty()) {
+ return Collections.emptyList();
+ }
+
+ String[] pairs = cookie.split(";");
+ List<Cookie> cookies = new LinkedList<Cookie>();
+ for (String pair : pairs) {
+ cookies.add(Cookie.parse(url, pair));
+ }
+
+ return cookies;
+ }
+}
diff --git a/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java b/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java
index e659a61..1bdf34e 100644
--- a/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java
+++ b/node_modules/react-native-fast-image/android/src/main/java/com/dylanvann/fastimage/FastImageOkHttpProgressGlideModule.java
@@ -43,6 +43,7 @@ public class FastImageOkHttpProgressGlideModule extends LibraryGlideModule {
OkHttpClient client = OkHttpClientProvider
.getOkHttpClient()
.newBuilder()
+ .cookieJar(new FastImageCookieJar())
.addInterceptor(createInterceptor(progressListener))
.build();
OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(client);
diff --git a/node_modules/react-native-fast-image/dist/index.d.ts b/node_modules/react-native-fast-image/dist/index.d.ts
index 8a91257..599775d 100644
--- a/node_modules/react-native-fast-image/dist/index.d.ts
+++ b/node_modules/react-native-fast-image/dist/index.d.ts
@@ -89,6 +89,10 @@ export interface FastImageProps extends AccessibilityProps, ViewProps {
* Render children within the image.
*/
children?: React.ReactNode;
+ /**
+ * Native ID to used with shared elements transition
+ */
+ nativeID?: string;
}
export interface FastImageStaticProperties {
resizeMode: typeof resizeMode;