mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: control the multi-select switch
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
addTransactionsToCategorizeSelected,
|
||||
removeTransactionsToCategorizeSelected,
|
||||
getOpenMatchingTransactionAside,
|
||||
getTransactionsToCategorizeIdsSelected,
|
||||
} from '@/store/banking/banking.reducer';
|
||||
|
||||
export const useSetBankingPlaidToken = () => {
|
||||
@@ -94,3 +95,18 @@ export const useGetOpenMatchingTransactionAside = () => {
|
||||
[openMatchingTransactionAside],
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the detarmined value whether the given transaction id is checked.
|
||||
* @param {number} transactionId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const useIsTransactionToCategorizeSelected = (transactionId: number) => {
|
||||
const transactionsToCategorizeIdsSelected = useSelector(
|
||||
getTransactionsToCategorizeIdsSelected,
|
||||
);
|
||||
return useMemo(
|
||||
() => transactionsToCategorizeIdsSelected.indexOf(transactionId) !== -1,
|
||||
[transactionsToCategorizeIdsSelected, transactionId],
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user