* Fix headers for ESR 5.9 * check if reactions is defined to avoid a crash with servers without metadata Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
This commit is contained in:
parent
f58c12f78d
commit
ac8887e30c
4 changed files with 16 additions and 4 deletions
|
|
@ -44,7 +44,12 @@ function makeMapStateToProps() {
|
|||
channel: channelId,
|
||||
permission: Permissions.ADD_REACTION,
|
||||
});
|
||||
canAddMoreReactions = Object.values(reactions).length < MAX_ALLOWED_REACTIONS;
|
||||
|
||||
if (reactions) {
|
||||
// On servers without metadata reactions at this point can be undefined
|
||||
canAddMoreReactions = Object.values(reactions).length < MAX_ALLOWED_REACTIONS;
|
||||
}
|
||||
|
||||
canRemoveReaction = haveIChannelPermission(state, {
|
||||
team: teamId,
|
||||
channel: channelId,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,14 @@ export function setCSRFFromCookie(url) {
|
|||
CookieManager.get(url, false).then((res) => {
|
||||
const token = res.MMCSRF;
|
||||
if (token) {
|
||||
Client4.setCSRF(token?.value || token);
|
||||
let value = null;
|
||||
if (typeof token === 'object' && Object.prototype.hasOwnProperty.call(token, 'value')) {
|
||||
value = token.value;
|
||||
} else {
|
||||
value = token;
|
||||
}
|
||||
|
||||
Client4.setCSRF(value);
|
||||
}
|
||||
resolve();
|
||||
});
|
||||
|
|
|
|||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mattermost-mobile",
|
||||
"version": "1.26.0",
|
||||
"version": "1.26.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -154,4 +154,4 @@
|
|||
"node_modules/(?!react-native|jail-monkey|@sentry/react-native|react-navigation|@react-native-community/cameraroll)"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue