Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | 6x 6x 6x 11x 4x 4x 4x 2x 1x 2x 2x 2x 2x | import {
GenericReleasesAction,
ReleasesReduxState,
DispatchFn,
} from "../../../types/releaseTypes";
export const OPEN_HISTORY = "OPEN_HISTORY";
export const CLOSE_HISTORY = "CLOSE_HISTORY";
import { triggerGAEvent } from "../actions/gaEventTracking";
import { CloseChannelAction } from "./pendingCloses";
export type OpenHistoryAction = GenericReleasesAction<
typeof OPEN_HISTORY,
Partial<ReleasesReduxState["history"]>
>;
export type CloseHistoryAction = GenericReleasesAction<typeof CLOSE_HISTORY, never>;
export type HistoryAction = OpenHistoryAction | CloseHistoryAction | CloseChannelAction;
export function openHistory(
filters: ReleasesReduxState["history"]["filters"]
): OpenHistoryAction {
return {
type: OPEN_HISTORY,
payload: { filters },
};
}
export function closeHistory(): CloseHistoryAction {
return {
type: CLOSE_HISTORY,
};
}
export function toggleHistory(
filters: ReleasesReduxState["history"]["filters"]
) {
return (dispatch: DispatchFn, getState: () => ReleasesReduxState) => {
const { history } = getState();
if (
history.isOpen &&
(history.filters == filters ||
(history.filters &&
filters &&
filters.track === history.filters.track &&
filters.arch === history.filters.arch &&
filters.risk === history.filters.risk &&
filters.branch === history.filters.branch))
) {
if (filters) {
dispatch(
triggerGAEvent(
`click-close-history`,
`${filters.track}/${filters.risk}/${filters.branch}/${filters.arch}`,
),
);
}
dispatch(closeHistory() as any);
} else {
Eif (filters) {
dispatch(
triggerGAEvent(
`click-open-history`,
`${filters.track}/${filters.risk}/${filters.branch}/${filters.arch}`,
),
);
}
dispatch(openHistory(filters));
}
};
}
|