mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-12-21 11:25:50 -05:00
feat: swap history tauri connector
This commit is contained in:
parent
cdd6635c8f
commit
2e1b6f6b43
22 changed files with 1315 additions and 1297 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';
|
||||
import type { AppDispatch, RootState } from 'renderer/store/storeRenderer';
|
||||
import { sortBy } from 'lodash';
|
||||
import { parseDateString } from 'utils/parseUtils';
|
||||
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
|
||||
import type { AppDispatch, RootState } from "renderer/store/storeRenderer";
|
||||
import { sortBy } from "lodash";
|
||||
import { parseDateString } from "utils/parseUtils";
|
||||
|
||||
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
||||
export const useAppDispatch = () => useDispatch<AppDispatch>();
|
||||
|
|
@ -22,7 +22,7 @@ export function useIsSwapRunning() {
|
|||
|
||||
export function useSwapInfo(swapId: string | null) {
|
||||
return useAppSelector((state) =>
|
||||
swapId ? state.rpc.state.swapInfos[swapId] ?? null : null,
|
||||
swapId ? (state.rpc.state.swapInfos[swapId] ?? null) : null,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -51,6 +51,6 @@ export function useSwapInfosSortedByDate() {
|
|||
const swapInfos = useAppSelector((state) => state.rpc.state.swapInfos);
|
||||
return sortBy(
|
||||
Object.values(swapInfos),
|
||||
(swap) => -parseDateString(swap.startDate),
|
||||
(swap) => -parseDateString(swap.start_date),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue