lbry-desktop/ui/redux/actions/blocked.js

21 lines
504 B
JavaScript
Raw Normal View History

// @flow
import * as ACTIONS from 'constants/action_types';
import { selectPrefsReady } from 'redux/selectors/sync';
import { doAlertWaitingForSync } from 'redux/actions/app';
2021-02-25 18:43:56 +01:00
export const doToggleMuteChannel = (uri: string) => (dispatch: Dispatch, getState: GetState) => {
const state = getState();
const ready = selectPrefsReady(state);
if (!ready) {
return dispatch(doAlertWaitingForSync());
}
dispatch({
type: ACTIONS.TOGGLE_BLOCK_CHANNEL,
data: {
uri,
},
});
};