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

Commit

Permalink
[MM-29723] Update subscription when payment status websocket event is…
Browse files Browse the repository at this point in the history
… received (#6817)
  • Loading branch information
devinbinnie committed Oct 19, 2020
1 parent 42129e3 commit 39ef1ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions actions/websocket_actions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
markChannelAsRead,
getChannelMemberCountsByGroup,
} from 'mattermost-redux/actions/channels';
import {getCloudSubscription} from 'mattermost-redux/actions/cloud';
import {loadRolesIfNeeded} from 'mattermost-redux/actions/roles';
import {setServerVersion} from 'mattermost-redux/actions/general';
import {
Expand Down Expand Up @@ -472,6 +473,9 @@ export function handleEvent(msg) {
case SocketEvents.SIDEBAR_CATEGORY_ORDER_UPDATED:
dispatch(handleSidebarCategoryOrderUpdated(msg));
break;
case SocketEvents.CLOUD_PAYMENT_STATUS_UPDATED:
dispatch(handleCloudPaymentStatusUpdated(msg));
break;

default:
}
Expand Down Expand Up @@ -1325,3 +1329,7 @@ function handleSidebarCategoryDeleted(msg) {
function handleSidebarCategoryOrderUpdated(msg) {
return receivedCategoryOrder(msg.broadcast.team_id, msg.data.order);
}

function handleCloudPaymentStatusUpdated() {
return (doDispatch) => doDispatch(getCloudSubscription());
}
1 change: 1 addition & 0 deletions utils/constants.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ export const SocketEvents = {
SIDEBAR_CATEGORY_UPDATED: 'sidebar_category_updated',
SIDEBAR_CATEGORY_DELETED: 'sidebar_category_deleted',
SIDEBAR_CATEGORY_ORDER_UPDATED: 'sidebar_category_order_updated',
CLOUD_PAYMENT_STATUS_UPDATED: 'cloud_payment_status_updated',
};

export const TutorialSteps = {
Expand Down

0 comments on commit 39ef1ae

Please sign in to comment.