forked from Ivasoft/mattermost-mobile
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f337b3690e | ||
|
|
700b3d1a2f | ||
|
|
0618ad432b | ||
|
|
680ead2f57 | ||
|
|
ae49f65458 | ||
|
|
7c933ed656 | ||
|
|
5279014271 | ||
|
|
1eb244b16f |
@@ -130,8 +130,8 @@ android {
|
||||
applicationId "com.mattermost.rnbeta"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 293
|
||||
versionName "1.31.0"
|
||||
versionCode 296
|
||||
versionName "1.31.2"
|
||||
multiDexEnabled = true
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
|
||||
|
||||
@@ -7,7 +7,6 @@ import {
|
||||
View,
|
||||
StyleSheet,
|
||||
} from 'react-native';
|
||||
import FastImage from 'react-native-fast-image';
|
||||
|
||||
import {Client4} from '@mm-redux/client';
|
||||
|
||||
@@ -51,29 +50,9 @@ export default class FileAttachmentImage extends PureComponent {
|
||||
resizeMethod: 'resize',
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
const {file} = props;
|
||||
if (file && file.id && !file.localPath) {
|
||||
const headers = Client4.getOptions({}).headers;
|
||||
|
||||
const preloadImages = [
|
||||
{uri: Client4.getFileThumbnailUrl(file.id), headers},
|
||||
{uri: Client4.getFileUrl(file.id), headers},
|
||||
];
|
||||
|
||||
if (isGif(file)) {
|
||||
preloadImages.push({uri: Client4.getFilePreviewUrl(file.id), headers});
|
||||
}
|
||||
|
||||
FastImage.preload(preloadImages);
|
||||
}
|
||||
|
||||
this.state = {
|
||||
failed: false,
|
||||
};
|
||||
}
|
||||
state = {
|
||||
failed: false,
|
||||
};
|
||||
|
||||
boxPlaceholder = () => {
|
||||
if (this.props.isSingleImage) {
|
||||
|
||||
@@ -153,7 +153,7 @@ export default class FileUploadItem extends PureComponent {
|
||||
|
||||
const certificate = await mattermostBucket.getPreference('cert');
|
||||
const options = {
|
||||
timeout: 10000,
|
||||
timeout: 60000,
|
||||
certificate,
|
||||
};
|
||||
this.uploadPromise = RNFetchBlob.config(options).fetch('POST', Client4.getFilesRoute(), headers, data);
|
||||
|
||||
@@ -77,7 +77,6 @@ export default class MarkdownImage extends ImageViewPort {
|
||||
uri = EphemeralStore.currentServerUrl + uri;
|
||||
}
|
||||
|
||||
FastImage.preload([{uri}]);
|
||||
return uri;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,14 +16,6 @@ export default class AttachmentAuthor extends PureComponent {
|
||||
theme: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
if (props.icon) {
|
||||
FastImage.preload([{uri: props.icon}]);
|
||||
}
|
||||
}
|
||||
|
||||
openLink = () => {
|
||||
const {link} = this.props;
|
||||
if (link && Linking.canOpenURL(link)) {
|
||||
|
||||
@@ -17,14 +17,6 @@ export default class AttachmentFooter extends PureComponent {
|
||||
theme: PropTypes.object.isRequired,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
if (props.icon) {
|
||||
FastImage.preload([{uri: props.icon}]);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
text,
|
||||
|
||||
@@ -110,8 +110,6 @@ export default class PostAttachmentOpenGraph extends PureComponent {
|
||||
dimensions = calculateDimensions(ogImage.height, ogImage.width, this.getViewPostWidth());
|
||||
}
|
||||
|
||||
FastImage.preload([{uri: imageUrl}]);
|
||||
|
||||
return {
|
||||
hasImage: true,
|
||||
...dimensions,
|
||||
|
||||
@@ -63,7 +63,6 @@ export default class ProfilePicture extends PureComponent {
|
||||
this.setImageURL(imageUri);
|
||||
} else if (user) {
|
||||
const uri = Client4.getProfilePictureUrl(user.id, user.last_picture_update);
|
||||
FastImage.preload([{uri, headers: Client4.getOptions({}).headers}]);
|
||||
|
||||
this.setImageURL(uri);
|
||||
this.clearProfileImageUri();
|
||||
@@ -104,7 +103,6 @@ export default class ProfilePicture extends PureComponent {
|
||||
|
||||
if (nextUrl && url !== nextUrl) {
|
||||
// empty function is so that promise unhandled is not triggered in dev mode
|
||||
FastImage.preload([{uri: nextUrl, headers: Client4.getOptions({}).headers}]);
|
||||
this.setImageURL(nextUrl);
|
||||
this.clearProfileImageUri();
|
||||
}
|
||||
|
||||
@@ -8,10 +8,6 @@ import Preferences from '@mm-redux/constants/preferences';
|
||||
|
||||
import ProgressiveImage from './progressive_image';
|
||||
|
||||
jest.mock('react-native-fast-image', () => ({
|
||||
preload: jest.fn(),
|
||||
}));
|
||||
|
||||
jest.useFakeTimers();
|
||||
|
||||
describe('ProgressiveImage', () => {
|
||||
|
||||
@@ -54,7 +54,6 @@ export default class TeamIcon extends React.PureComponent {
|
||||
|
||||
preloadTeamIcon = (teamId, lastIconUpdate) => {
|
||||
const uri = Client4.getTeamIconUrl(teamId, lastIconUpdate);
|
||||
FastImage.preload([{uri, headers: Client4.getOptions({}).headers}]);
|
||||
this.setImageURL(uri);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {Alert} from 'react-native';
|
||||
import {Alert, Platform} from 'react-native';
|
||||
import ReactNativeHapticFeedback from 'react-native-haptic-feedback';
|
||||
|
||||
import {Posts} from '@mm-redux/constants';
|
||||
@@ -86,6 +86,10 @@ export function isPendingPost(postId, userId) {
|
||||
}
|
||||
|
||||
export function validatePreviousVersion(previousVersion) {
|
||||
if (Platform.OS === 'ios') {
|
||||
INVALID_VERSIONS.push('1.31.0', '1.31.1');
|
||||
}
|
||||
|
||||
if (!previousVersion || INVALID_VERSIONS.includes(previousVersion)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -926,7 +926,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 293;
|
||||
CURRENT_PROJECT_VERSION = 296;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -964,7 +964,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 293;
|
||||
CURRENT_PROJECT_VERSION = 296;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
||||
ENABLE_BITCODE = NO;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.31.0</string>
|
||||
<string>1.31.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -34,7 +34,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>293</string>
|
||||
<string>296</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.31.0</string>
|
||||
<string>1.31.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>293</string>
|
||||
<string>296</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.31.0</string>
|
||||
<string>1.31.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>293</string>
|
||||
<string>296</string>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mattermost-mobile",
|
||||
"version": "1.31.0",
|
||||
"version": "1.31.2",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mattermost-mobile",
|
||||
"version": "1.31.0",
|
||||
"version": "1.31.2",
|
||||
"description": "Mattermost Mobile with React Native",
|
||||
"repository": "git@github.com:mattermost/mattermost-mobile.git",
|
||||
"author": "Mattermost, Inc.",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
index 260ed81..52b53d8 100644
|
||||
index 260ed81..f719679 100644
|
||||
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
||||
@@ -56,14 +56,18 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
||||
@@ -29,6 +29,21 @@ index 260ed81..52b53d8 100644
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -196,8 +200,12 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
||||
|
||||
protected void handle(Runnable task) {
|
||||
UiThread.post(() -> {
|
||||
- if (getCurrentActivity() != null && !activity().isFinishing()) {
|
||||
- task.run();
|
||||
+ try {
|
||||
+ if (getCurrentActivity() != null && !activity().isFinishing()) {
|
||||
+ task.run();
|
||||
+ }
|
||||
+ } catch (ClassCastException e) {
|
||||
+ // The most current activity is not a NavigationActivity
|
||||
}
|
||||
});
|
||||
}
|
||||
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java
|
||||
index f60119e..4c46e8c 100644
|
||||
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java
|
||||
|
||||
@@ -129,13 +129,6 @@ jest.mock('react-native-device-info', () => {
|
||||
};
|
||||
});
|
||||
|
||||
jest.mock('react-native-fast-image', () => {
|
||||
const FastImage = require.requireActual('react-native-fast-image').default;
|
||||
FastImage.preload = jest.fn();
|
||||
|
||||
return FastImage;
|
||||
});
|
||||
|
||||
jest.mock('rn-fetch-blob', () => ({
|
||||
fs: {
|
||||
dirs: {
|
||||
|
||||
Reference in New Issue
Block a user