Compare commits

..

8 Commits

Author SHA1 Message Date
Elias Nahum
f337b3690e Bump app version number to 1.31.2 (#4361) 2020-05-27 15:46:24 -04:00
Elias Nahum
700b3d1a2f Bump app build number to 296 (#4360) 2020-05-27 15:39:26 -04:00
Mattermost Build
0618ad432b Bump upload timeout to 1 min (#4358)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-05-27 13:02:26 -04:00
Mattermost Build
680ead2f57 Invalidate versions for iOS (#4355)
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-05-27 12:44:07 -04:00
Miguel Alatzar
ae49f65458 Bump app version number to 1.31.1 (#4340) 2020-05-22 11:06:13 -07:00
Miguel Alatzar
7c933ed656 Bump app build number to 295 (#4337) 2020-05-22 10:58:09 -07:00
Miguel Alatzar
5279014271 Catch ClassCastException (#4334) 2020-05-22 10:14:38 -07:00
Elias Nahum
1eb244b16f Do not preload images with FastImage (#4314) 2020-05-22 12:38:42 -04:00
19 changed files with 37 additions and 72 deletions

View File

@@ -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'

View File

@@ -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) {

View File

@@ -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);

View File

@@ -77,7 +77,6 @@ export default class MarkdownImage extends ImageViewPort {
uri = EphemeralStore.currentServerUrl + uri;
}
FastImage.preload([{uri}]);
return uri;
};

View File

@@ -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)) {

View File

@@ -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,

View File

@@ -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,

View File

@@ -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();
}

View File

@@ -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', () => {

View File

@@ -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);
};

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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>

View File

@@ -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>

View File

@@ -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
View File

@@ -1,6 +1,6 @@
{
"name": "mattermost-mobile",
"version": "1.31.0",
"version": "1.31.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -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.",

View File

@@ -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

View File

@@ -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: {