Skip to content

Commit

Permalink
fix: save modal data as a ref
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciosantise committed Aug 28, 2024
1 parent 2f3027b commit b6bc29b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion wallets/rn_cli_wallet/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ android {
applicationId "com.walletconnect.web3wallet.rnsample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 31
versionCode 32
versionName "1.0"
resValue "string", "build_config_package", "com.walletconnect.web3wallet.rnsample"
}
Expand Down
3 changes: 1 addition & 2 deletions wallets/rn_cli_wallet/src/modals/SessionSignModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function SessionSignModal() {
const {request, chainId} = params;
const chain = PresetsUtil.getChainData(chainId.split(':')[1]);
const peerMetadata = session?.peer?.metadata as SignClientTypes.Metadata;
const method = requestEvent?.params?.request?.method!;

// Get message, convert it to UTF8 string if it is valid hex
const message = getSignParamsMessage(request.params);
Expand Down Expand Up @@ -80,8 +81,6 @@ export default function SessionSignModal() {
}
}, [requestEvent, topic]);

const method = requestEvent?.params?.request?.method!;

// Ensure request and wallet are defined
if (!requestEvent || !session) {
return <Text>Missing request data</Text>;
Expand Down
4 changes: 2 additions & 2 deletions wallets/rn_cli_wallet/src/store/ModalStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {SessionTypes, SignClientTypes} from '@walletconnect/types';
import {Web3WalletTypes} from '@walletconnect/web3wallet';
import {proxy} from 'valtio';
import {proxy, ref} from 'valtio';

/**
* Types
Expand Down Expand Up @@ -44,7 +44,7 @@ const ModalStore = {

open(view: State['view'], data: State['data']) {
state.view = view;
state.data = data;
state.data = data ? ref(data) : undefined;
state.open = true;
},

Expand Down
2 changes: 1 addition & 1 deletion wallets/rn_cli_wallet/src/store/SettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const SettingsStore = {
state.activeChainId = value;
},

setCurrentRequestVerifyContext(context: Verify.Context) {
setCurrentRequestVerifyContext(context?: Verify.Context) {
state.currentRequestVerifyContext = context;
},

Expand Down

0 comments on commit b6bc29b

Please sign in to comment.