Skip to content

Commit

Permalink
fix: solved appcrash when getting logs with email provider
Browse files Browse the repository at this point in the history
  • Loading branch information
ignaciosantise committed Jul 30, 2024
1 parent 117656c commit ec81f32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dapps/W3MWagmi/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ android {
applicationId "com.walletconnect.web3modal.rnsample"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 40
versionCode 41
versionName "1.1"
resValue "string", "build_config_package", "com.w3mwagmi"
}
Expand Down
6 changes: 3 additions & 3 deletions dapps/W3MWagmi/src/hooks/useLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ export function useLogs() {
const [provider, setProvider] = useState<any>(null);

const getLogs = useCallback(async () => {
if (provider) {
if (provider?.signer?.client?.core) {
const _logs =
await provider.signer.client.core.logChunkController?.getLogArray();
SettingsStore.setLogs(_logs.reverse());
await provider.signer?.client.core.logChunkController?.getLogArray();
SettingsStore.setLogs(_logs ? _logs.reverse() : []);
}
}, [provider]);

Expand Down
4 changes: 2 additions & 2 deletions dapps/W3MWagmi/src/hooks/useSocketStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export function useSocketStatus() {
}, [connector]);

useEffect(() => {
if (provider) {
provider.signer.client.core.relayer.on(RELAYER_EVENTS.connect, () => {
if (provider?.signer?.client?.core) {
provider?.signer?.client?.core.relayer.on(RELAYER_EVENTS.connect, () => {
Toast.show({
type: 'success',
text1: 'Network connection is restored!',
Expand Down

0 comments on commit ec81f32

Please sign in to comment.