@@ -7,10 +7,10 @@ import { useSnapPoints } from '../../hooks/bottomSheet';
77import { useAppDispatch , useAppSelector } from '../../hooks/redux' ;
88import { startCoopCloseTimestampSelector } from '../../store/reselect/user' ;
99import { clearCoopCloseTimer } from '../../store/slices/user' ;
10- import { closeSheet , showBottomSheet } from '../../store/utils/ui' ;
1110import { Display } from '../../styles/text' ;
1211import { closeAllChannels } from '../../utils/lightning' ;
1312import { showToast } from '../../utils/notifications' ;
13+ import { useSheetRef } from './SheetRefsProvider' ;
1414
1515const imageSrc = require ( '../../assets/illustrations/exclamation-mark.png' ) ;
1616
@@ -21,10 +21,12 @@ const ForceTransfer = (): ReactElement => {
2121 const { t } = useTranslation ( 'lightning' ) ;
2222 const snapPoints = useSnapPoints ( 'large' ) ;
2323 const dispatch = useAppDispatch ( ) ;
24+ const sheetRef = useSheetRef ( 'forceTransfer' ) ;
2425 const startTime = useAppSelector ( startCoopCloseTimestampSelector ) ;
2526 const [ isPending , setIsPending ] = useState ( false ) ;
2627
2728 // try to cooperatively close the channel(s) for 30min
29+ // biome-ignore lint/correctness/useExhaustiveDependencies: sheetRef doesn't change
2830 useEffect ( ( ) => {
2931 // biome-ignore lint/style/useConst: false alarm
3032 let interval : NodeJS . Timer ;
@@ -57,7 +59,7 @@ const ForceTransfer = (): ReactElement => {
5759 console . log ( 'giving up on coop close.' ) ;
5860 dispatch ( clearCoopCloseTimer ( ) ) ;
5961 clearInterval ( interval ) ;
60- showBottomSheet ( 'forceTransfer' ) ;
62+ sheetRef . current ?. present ( ) ;
6163 return ;
6264 }
6365
@@ -70,7 +72,7 @@ const ForceTransfer = (): ReactElement => {
7072 } , [ startTime , dispatch ] ) ;
7173
7274 const onCancel = ( ) : void => {
73- closeSheet ( 'forceTransfer' ) ;
75+ sheetRef . current ?. close ( ) ;
7476 } ;
7577
7678 const onContinue = async ( ) : Promise < void > => {
@@ -96,7 +98,7 @@ const ForceTransfer = (): ReactElement => {
9698 title : t ( 'force_init_title' ) ,
9799 description : t ( 'force_init_msg' ) ,
98100 } ) ;
99- closeSheet ( 'forceTransfer' ) ;
101+ sheetRef . current ?. close ( ) ;
100102 } else {
101103 showToast ( {
102104 type : 'warning' ,
0 commit comments