Skip to content

Commit d3c1f6e

Browse files
committed
Rename: {s,useS}yncConfirmPath
1 parent 0e10ad7 commit d3c1f6e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ui/pages/confirmations/context/confirm/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useDispatch } from 'react-redux';
1111

1212
import { setAccountDetailsAddress } from '../../../../store/actions';
1313
import useCurrentConfirmation from '../../hooks/useCurrentConfirmation';
14-
import syncConfirmPath from '../../hooks/syncConfirmPath';
14+
import useSyncConfirmPath from '../../hooks/useSyncConfirmPath';
1515
import { Confirmation } from '../../types/confirm';
1616

1717
export type ConfirmContextType = {
@@ -30,7 +30,7 @@ export const ConfirmContextProvider: React.FC<{
3030
const [isScrollToBottomCompleted, setIsScrollToBottomCompleted] =
3131
useState(true);
3232
const { currentConfirmation } = useCurrentConfirmation();
33-
syncConfirmPath(currentConfirmation);
33+
useSyncConfirmPath(currentConfirmation);
3434
const dispatch = useDispatch();
3535

3636
const value = useMemo(

ui/pages/confirmations/hooks/syncConfirmPath.test.ts renamed to ui/pages/confirmations/hooks/useSyncConfirmPath.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ApprovalType } from '@metamask/controller-utils';
22
import mockState from '../../../../test/data/mock-state.json';
33
import { unapprovedPersonalSignMsg } from '../../../../test/data/confirmations/personal_sign';
44
import { renderHookWithConfirmContextProvider } from '../../../../test/lib/confirmations/render-helpers';
5-
import syncConfirmPath from './syncConfirmPath';
5+
import useSyncConfirmPath from './useSyncConfirmPath';
66

77
const mockHistoryReplace = jest.fn();
88

@@ -27,7 +27,7 @@ const STATE_MOCK = {
2727
describe('syncConfirmPath', () => {
2828
it('should execute correctly', () => {
2929
const result = renderHookWithConfirmContextProvider(
30-
() => syncConfirmPath(unapprovedPersonalSignMsg),
30+
() => useSyncConfirmPath(unapprovedPersonalSignMsg),
3131
STATE_MOCK,
3232
);
3333
expect(result).toBeDefined();
@@ -36,7 +36,7 @@ describe('syncConfirmPath', () => {
3636
it('should replace history route', () => {
3737
mockHistoryReplace.mockClear();
3838
renderHookWithConfirmContextProvider(
39-
() => syncConfirmPath(unapprovedPersonalSignMsg),
39+
() => useSyncConfirmPath(unapprovedPersonalSignMsg),
4040
STATE_MOCK,
4141
);
4242
expect(mockHistoryReplace).toHaveBeenCalled();

0 commit comments

Comments
 (0)