@@ -4,6 +4,7 @@ import { GatewayTransaction } from "@renproject/ren";
4
4
import { TransactionParams } from "@renproject/ren/build/module/params" ;
5
5
import { useCallback , useState } from "react" ;
6
6
import { useSelector } from "react-redux" ;
7
+ import { useNotifications } from "../../providers/Notifications" ;
7
8
import { $network } from "../network/networkSlice" ;
8
9
9
10
const useLocalStorage = < T > (
@@ -118,6 +119,7 @@ export const useTxsStorage = () => {
118
119
[ findLocalTx ]
119
120
) ;
120
121
122
+ const { showNotification } = useNotifications ( ) ;
121
123
const persistLocalTx : LocalTxPersistor = useCallback (
122
124
( web3Address , tx , done = false , meta ) => {
123
125
console . log ( "tx: persisting local tx" , web3Address , tx , done ) ;
@@ -131,7 +133,14 @@ export const useTxsStorage = () => {
131
133
}
132
134
133
135
setLocalTxs ( ( txs ) => {
134
- const current = ( txs [ web3Address ] || { } ) [ tx . hash ] || { } ;
136
+ const empty = { } ;
137
+ const current = ( txs [ web3Address ] || { } ) [ tx . hash ] || empty ;
138
+ if ( current !== empty ) {
139
+ showNotification (
140
+ "Bookmark this page to ensure you don’t lose track of your transaction." ,
141
+ { variant : "info" }
142
+ ) ;
143
+ }
135
144
// don't overwrite done transactions;
136
145
if ( current . done ) {
137
146
return txs ;
@@ -152,7 +161,7 @@ export const useTxsStorage = () => {
152
161
} ;
153
162
} ) ;
154
163
} ,
155
- [ setLocalTxs ]
164
+ [ setLocalTxs , showNotification ]
156
165
) ;
157
166
158
167
const removeLocalTx : LocalTxRemover = useCallback (
0 commit comments