Co-authored-by: Daniel Espino García <larkox@gmail.com> Co-authored-by: Michael Kochell <6913320+mickmister@users.noreply.github.com> Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
18 lines
770 B
TypeScript
18 lines
770 B
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {fetchAppBindings} from '@mm-redux/actions/apps';
|
|
import {getCurrentChannelId} from '@mm-redux/selectors/entities/common';
|
|
import {getCurrentUserId} from '@mm-redux/selectors/entities/users';
|
|
import {ActionResult, DispatchFunc, GetStateFunc} from '@mm-redux/types/actions';
|
|
import {appsEnabled} from '@utils/apps';
|
|
|
|
export function handleRefreshAppsBindings() {
|
|
return (dispatch: DispatchFunc, getState: GetStateFunc): ActionResult => {
|
|
const state = getState();
|
|
if (appsEnabled(state)) {
|
|
dispatch(fetchAppBindings(getCurrentUserId(state), getCurrentChannelId(state)));
|
|
}
|
|
return {data: true};
|
|
};
|
|
}
|