Skip to content

Commit

Permalink
PLT-8335 Fixing issue where posts do not send on iOS classic (matterm…
Browse files Browse the repository at this point in the history
…ost#476)

* PLT-8335 Fixing issue where posts do not send on iOS classic

* Fixing eslint error

* Updating redux to latest from 4.5 branch
  • Loading branch information
coreyhulen authored and crspeller committed Dec 14, 2017
1 parent 76d2761 commit 5e5a1e6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion actions/post_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {getSelectedPostId} from 'selectors/rhs';

import {ActionTypes, Constants} from 'utils/constants.jsx';
import {EMOJI_PATTERN} from 'utils/emoticons.jsx';
import * as UserAgent from 'utils/user_agent';

const dispatch = store.dispatch;
const getState = store.getState;
Expand Down Expand Up @@ -121,7 +122,12 @@ export async function createPost(post, files, success) {
}
}

await PostActions.createPost(post, files)(dispatch, getState);
if (UserAgent.isIosClassic()) {
await PostActions.createPostImmediately(post, files)(dispatch, getState);
} else {
await PostActions.createPost(post, files)(dispatch, getState);
}

if (post.root_id) {
PostStore.storeCommentDraft(post.root_id, null);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"localforage-observable": "1.4.0",
"marked": "mattermost/marked#802e981ade71149a497cbe79d12b8a3f82f7657e",
"match-at": "0.1.1",
"mattermost-redux": "mattermost/mattermost-redux.git#3688abb1a0b820305e371dfda38017b66ccf232e",
"mattermost-redux": "mattermost/mattermost-redux.git#b5ebee257af03af32ec00c6d4d2a442bdf34cb04",
"object-assign": "4.1.1",
"pdfjs-dist": "2.0.106",
"perfect-scrollbar": "0.8.1",
Expand Down
4 changes: 4 additions & 0 deletions utils/user_agent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ export function isAndroidWeb() {
return isAndroidChrome();
}

export function isIosClassic() {
return isMobileApp() && isIos();
}

// Returns true if and only if the user is using a Mattermost mobile app. This will return false if the user is using the
// web browser on a mobile device.
export function isMobileApp() {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5614,10 +5614,10 @@ math-expression-evaluator@^1.2.14:
version "1.2.16"
resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.16.tgz#b357fa1ca9faefb8e48d10c14ef2bcb2d9f0a7c9"

mattermost-redux@mattermost/mattermost-redux.git#3688abb1a0b820305e371dfda38017b66ccf232e:
mattermost-redux@mattermost/mattermost-redux.git#b5ebee257af03af32ec00c6d4d2a442bdf34cb04:
version "1.1.0"
uid "3688abb1a0b820305e371dfda38017b66ccf232e"
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/3688abb1a0b820305e371dfda38017b66ccf232e"
uid "b5ebee257af03af32ec00c6d4d2a442bdf34cb04"
resolved "https://codeload.github.com/mattermost/mattermost-redux/tar.gz/b5ebee257af03af32ec00c6d4d2a442bdf34cb04"
dependencies:
deep-equal "1.0.1"
form-data "2.3.1"
Expand Down

0 comments on commit 5e5a1e6

Please sign in to comment.