forked from Ivasoft/mattermost-mobile
Fix headers for ESR 5.9 (#3738)
* Fix headers for ESR 5.9 * check if reactions is defined to avoid a crash with servers without metadata
This commit is contained in:
committed by
Miguel Alatzar
parent
2fa2e05f49
commit
a8e3b608ad
@@ -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)"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user