forked from Ivasoft/mattermost-mobile
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9508d30f9 | ||
|
|
e2c2dcd3ac | ||
|
|
d07d85ef9d | ||
|
|
8aa4c1467d | ||
|
|
c10d31c62b | ||
|
|
54857865ec | ||
|
|
4796c3034e | ||
|
|
3055a43ec8 | ||
|
|
e19b6a08d3 | ||
|
|
92b992d204 |
@@ -113,8 +113,8 @@ android {
|
||||
applicationId "com.mattermost.rnbeta"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 23
|
||||
versionCode 112
|
||||
versionName "1.9.0"
|
||||
versionCode 114
|
||||
versionName "1.9.1"
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "x86"
|
||||
}
|
||||
|
||||
10
app/app.js
10
app/app.js
@@ -76,6 +76,7 @@ export default class App {
|
||||
return Initialization.credentials;
|
||||
},
|
||||
() => {
|
||||
this.waitForRehydration = true;
|
||||
return getGenericPassword();
|
||||
}
|
||||
);
|
||||
@@ -153,6 +154,13 @@ export default class App {
|
||||
}
|
||||
const username = `${deviceToken}, ${currentUserId}`;
|
||||
const password = `${token},${url}`;
|
||||
|
||||
if (this.waitForRehydration) {
|
||||
this.waitForRehydration = false;
|
||||
this.token = token;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
setGenericPassword(username, password);
|
||||
};
|
||||
|
||||
@@ -215,7 +223,7 @@ export default class App {
|
||||
};
|
||||
|
||||
startApp = () => {
|
||||
if (this.appStarted) {
|
||||
if (this.appStarted || this.waitForRehydration) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
import React, {PureComponent} from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import {Alert, BackHandler, Keyboard, Platform, Text, TextInput, TouchableOpacity, View} from 'react-native';
|
||||
import {Alert, BackHandler, Keyboard, Platform, Text, TouchableOpacity, View} from 'react-native';
|
||||
import {intlShape} from 'react-intl';
|
||||
import {RequestStatus} from 'mattermost-redux/constants';
|
||||
import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
||||
@@ -11,6 +11,7 @@ import EventEmitter from 'mattermost-redux/utils/event_emitter';
|
||||
import AttachmentButton from 'app/components/attachment_button';
|
||||
import Autocomplete from 'app/components/autocomplete';
|
||||
import FileUploadPreview from 'app/components/file_upload_preview';
|
||||
import QuickTextInput from 'app/components/quick_text_input';
|
||||
import {INITIAL_HEIGHT, INSERT_TO_COMMENT, INSERT_TO_DRAFT, IS_REACTION_REGEX, MAX_CONTENT_HEIGHT, MAX_FILE_COUNT} from 'app/constants/post_textbox';
|
||||
import {changeOpacity, makeStyleSheetFromTheme} from 'app/utils/theme';
|
||||
|
||||
@@ -494,7 +495,7 @@ export default class PostTextbox extends PureComponent {
|
||||
<View style={style.inputWrapper}>
|
||||
{!channelIsReadOnly && attachmentButton}
|
||||
<View style={[inputContainerStyle, (channelIsReadOnly && {marginLeft: 10})]}>
|
||||
<TextInput
|
||||
<QuickTextInput
|
||||
ref='input'
|
||||
value={textValue}
|
||||
onChangeText={this.handleTextChange}
|
||||
|
||||
86
app/components/quick_text_input.js
Normal file
86
app/components/quick_text_input.js
Normal file
@@ -0,0 +1,86 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import {TextInput} from 'react-native';
|
||||
|
||||
// A component that can be used to make partially-controlled inputs that can be updated
|
||||
// by changing the value prop without lagging the UI
|
||||
export default class QuickTextInput extends React.PureComponent {
|
||||
static propTypes = {
|
||||
|
||||
/**
|
||||
* Whether to delay updating the value of the textbox from props. Should only be used
|
||||
* on textboxes that require it to properly compose CJK characters as the user types.
|
||||
*/
|
||||
delayInputUpdate: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* The string value displayed in this input
|
||||
*/
|
||||
value: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
delayInputUpdate: false,
|
||||
value: '',
|
||||
};
|
||||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (prevProps.value !== this.props.value) {
|
||||
if (this.props.delayInputUpdate) {
|
||||
requestAnimationFrame(this.updateInputFromProps);
|
||||
} else {
|
||||
this.updateInputFromProps();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateInputFromProps = () => {
|
||||
if (!this.input) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.input.setNativeProps({text: this.props.value});
|
||||
}
|
||||
|
||||
get value() {
|
||||
return this.input.value;
|
||||
}
|
||||
|
||||
set value(value) {
|
||||
this.input.setNativeProps({text: this.props.value});
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.input.focus();
|
||||
}
|
||||
|
||||
blur() {
|
||||
this.input.blur();
|
||||
}
|
||||
|
||||
getInput = () => {
|
||||
return this.input;
|
||||
};
|
||||
|
||||
setInput = (input) => {
|
||||
this.input = input;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {value, ...props} = this.props;
|
||||
|
||||
Reflect.deleteProperty(props, 'delayInputUpdate');
|
||||
|
||||
// Only set the defaultValue since the real one will be updated using componentDidUpdate if necessary
|
||||
return (
|
||||
<TextInput
|
||||
{...props}
|
||||
ref={this.setInput}
|
||||
defaultValue={value}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,16 @@ export default class SearchBarAndroid extends PureComponent {
|
||||
};
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(nextProps, prevState) {
|
||||
if (nextProps.value !== prevState.value) {
|
||||
return {
|
||||
value: nextProps.value,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
cancel = () => {
|
||||
this.onCancelButtonPress();
|
||||
};
|
||||
|
||||
@@ -18,11 +18,15 @@ Client4.doFetchWithResponse = async (url, options) => {
|
||||
url,
|
||||
};
|
||||
}
|
||||
const response = await fetch(url, Client4.getOptions(options));
|
||||
const headers = response.headers;
|
||||
|
||||
let response;
|
||||
let headers;
|
||||
|
||||
let data;
|
||||
try {
|
||||
response = await fetch(url, Client4.getOptions(options));
|
||||
headers = response.headers;
|
||||
|
||||
data = await response.json();
|
||||
} catch (err) {
|
||||
if (response && response.resp && response.resp.data && response.resp.data.includes('SSL certificate')) {
|
||||
|
||||
@@ -153,6 +153,8 @@ export default class Entry extends PureComponent {
|
||||
if (credentials.token && credentials.url) {
|
||||
Client4.setToken(credentials.token);
|
||||
Client4.setUrl(stripTrailingSlashes(credentials.url));
|
||||
} else if (app.waitForRehydration) {
|
||||
app.waitForRehydration = false;
|
||||
}
|
||||
|
||||
if (currentUserId) {
|
||||
|
||||
@@ -2516,7 +2516,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 112;
|
||||
CURRENT_PROJECT_VERSION = 114;
|
||||
DEAD_CODE_STRIPPING = NO;
|
||||
DEVELOPMENT_TEAM = UQ8HT4Q2XM;
|
||||
ENABLE_BITCODE = NO;
|
||||
@@ -2566,7 +2566,7 @@
|
||||
CODE_SIGN_ENTITLEMENTS = Mattermost/Mattermost.entitlements;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
CURRENT_PROJECT_VERSION = 112;
|
||||
CURRENT_PROJECT_VERSION = 114;
|
||||
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.9.0</string>
|
||||
<string>1.9.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -34,7 +34,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>112</string>
|
||||
<string>114</string>
|
||||
<key>ITSAppUsesNonExemptEncryption</key>
|
||||
<false/>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>XPC!</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.9.0</string>
|
||||
<string>1.9.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>112</string>
|
||||
<string>114</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.9.0</string>
|
||||
<string>1.9.1</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>112</string>
|
||||
<string>114</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
1991
package-lock.json
generated
1991
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -15,12 +15,12 @@
|
||||
"intl": "1.2.5",
|
||||
"jail-monkey": "1.0.0",
|
||||
"jsc-android": "216113.0.3",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#c9b633da7fc3fc9ba3cc40ecc9665e088defbe73",
|
||||
"mattermost-redux": "github:mattermost/mattermost-redux#d2e9ba4f30a7bdfccda9aab1cfa8124c4ca1f275",
|
||||
"mime-db": "1.33.0",
|
||||
"prop-types": "15.6.1",
|
||||
"react": "16.3.2",
|
||||
"react-intl": "2.4.0",
|
||||
"react-native": "0.55.3",
|
||||
"react-native": "github:enahum/react-native#text-0.55",
|
||||
"react-native-animatable": "1.2.4",
|
||||
"react-native-bottom-sheet": "1.0.3",
|
||||
"react-native-button": "2.3.0",
|
||||
@@ -32,7 +32,7 @@
|
||||
"react-native-drawer": "2.5.0",
|
||||
"react-native-exception-handler": "2.7.5",
|
||||
"react-native-fast-image": "4.0.8",
|
||||
"react-native-fetch-blob": "enahum/react-native-fetch-blob.git#c4c798032d9c255fbae75d13a0a985af9b8b42ca",
|
||||
"react-native-fetch-blob": "enahum/react-native-fetch-blob.git#27983c83d7fad1cb4821dd6ba8e405da4af64f3a",
|
||||
"react-native-image-gallery": "enahum/react-native-image-gallery#a98b1051e94f5a394541ca1ff9b15e2c9ffed84f",
|
||||
"react-native-image-picker": "0.26.7",
|
||||
"react-native-keyboard-aware-scroll-view": "0.5.0",
|
||||
|
||||
Reference in New Issue
Block a user