Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
Relese5.0 merge master 20180611 (#529)
Browse files Browse the repository at this point in the history
* MM-10776: Adds support for new API endpoint to update team or channel member scheme roles. (#521)

* Disable fetch calls when offline (#522)

* Disable fetch calls when offline

* Move online check to doFetchWithResponse

* fix permission error on channel_converted event (in used by mobile RN) (#523)

* warn about dropping backwards compatibility just once (#525)

* Safely trying to instantiate Set. (#527)

* Safely trying to instantiate Set.

* Added warning

* Removes console.warn.
  • Loading branch information
cpanato authored and hmhealey committed Aug 28, 2020
1 parent a0e04b2 commit 1c47989
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/mattermost-redux/src/actions/roles.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ export function setPendingRoles(roles) {
export function loadRolesIfNeeded(roles) {
return async (dispatch, getState) => {
const state = getState();
const pendingRoles = new Set(state.entities.roles.pending);
let pendingRoles = new Set();
try {
pendingRoles = new Set(state.entities.roles.pending);
} catch (e) {
// eslint-disable-line
}
for (const role of roles) {
pendingRoles.add(role);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/mattermost-redux/src/store/initial_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const state: GlobalState = {
typing: {},
roles: {
roles: {},
pending: [],
pending: new Set(),
},
schemes: {schemes: {}},
},
Expand Down
7 changes: 7 additions & 0 deletions packages/mattermost-redux/src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,16 @@ export const isMinimumServerVersion = (currentVersion, minMajorVersion = 0, minM
// Dot version is equal
return true;
};

let sentMessageToRemoveBackwardsCompatibility = false;
export const sendMessageToRemoveBackwardsCompatibility = (currentVersion, minVersion) => {
if (process.env.NODE_ENV !== 'production' && currentVersion > minVersion) { //eslint-disable-line no-process-env
if (sentMessageToRemoveBackwardsCompatibility) {
return;
}

console.warn('You can now remove backwards-compatibility code from the project, as referenced in the stacktrace below.'); //eslint-disable-line no-console
sentMessageToRemoveBackwardsCompatibility = true;
}
};

Expand Down

0 comments on commit 1c47989

Please sign in to comment.