@@ -168,13 +168,13 @@ function* init() {
168
168
*/
169
169
export function * listenForNetworkChange ( ) {
170
170
let previousGenesisHash = yield select ( ( state ) => get ( state . serverInfo , 'genesisHash' ) ) ;
171
-
171
+
172
172
while ( true ) {
173
173
// Wait for the server info to be updated with the new network data
174
174
yield take ( types . SERVER_INFO_UPDATED ) ;
175
-
175
+
176
176
const currentGenesisHash = yield select ( ( state ) => get ( state . serverInfo , 'genesisHash' ) ) ;
177
-
177
+
178
178
if ( previousGenesisHash !== currentGenesisHash ) {
179
179
log . debug ( 'Genesis hash changed, clearing reown sessions.' ) ;
180
180
yield call ( clearSessions ) ;
@@ -214,12 +214,12 @@ export function* refreshActiveSessions(extend = false) {
214
214
}
215
215
216
216
const activeSessions = yield call ( ( ) => walletKit . getActiveSessions ( ) ) ;
217
-
217
+
218
218
yield put ( setReownSessions ( activeSessions || { } ) ) ;
219
219
220
220
if ( extend ) {
221
221
const sessionKeys = Object . keys ( activeSessions || { } ) ;
222
-
222
+
223
223
for ( const key of sessionKeys ) {
224
224
log . debug ( 'Extending session ' ) ;
225
225
log . debug ( activeSessions [ key ] . topic ) ;
@@ -808,7 +808,7 @@ export function* onWalletReset() {
808
808
*/
809
809
export function * onSessionProposal ( action ) {
810
810
const { id, params } = action . payload ;
811
-
811
+
812
812
// Ensure connection state is set to CONNECTING at the beginning of the saga
813
813
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . CONNECTING ) ) ;
814
814
@@ -830,13 +830,13 @@ export function* onSessionProposal(action) {
830
830
log . error ( 'Unsupported methods requested:' , unsupportedMethods ) ;
831
831
// Set connection state to FAILED
832
832
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
833
-
833
+
834
834
// Show error modal to user
835
835
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
836
836
title : 'Connection Error' ,
837
837
message : `The dApp is requesting methods that are not supported: ${ unsupportedMethods . join ( ', ' ) } ` ,
838
838
} ) ) ;
839
-
839
+
840
840
// Reject the session
841
841
const { walletKit } = getGlobalReown ( ) ;
842
842
if ( walletKit ) {
@@ -922,16 +922,16 @@ export function* onSessionProposal(action) {
922
922
} catch ( error ) {
923
923
log . error ( 'Error handling session proposal:' , error ) ;
924
924
yield put ( onExceptionCaptured ( error ) ) ;
925
-
925
+
926
926
// Set connection state to FAILED
927
927
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
928
-
928
+
929
929
// Show error modal to user
930
930
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
931
931
title : 'Connection Error' ,
932
932
message : `Failed to connect to dApp: ${ error . message } ` ,
933
933
} ) ) ;
934
-
934
+
935
935
// Try to reject the session if possible
936
936
try {
937
937
const { walletKit } = getGlobalReown ( ) ;
@@ -981,7 +981,7 @@ export function* onUriInputted(action) {
981
981
log . debug ( 'Error pairing: ' , error ) ;
982
982
// Connection failed
983
983
yield put ( setWCConnectionState ( REOWN_CONNECTION_STATE . FAILED ) ) ;
984
-
984
+
985
985
// Show error modal to user
986
986
yield put ( showGlobalModal ( MODAL_TYPES . ERROR_MODAL , {
987
987
title : 'Connection Error' ,
0 commit comments