Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Udapp disconnect fix #5639

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env → .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ gist_token=<token>
account_passphrase=<passphrase>
account_password=<password>
NODE_OPTIONS=--max-old-space-size=2048
# WALLET_CONNECT_PROJECT_ID=<walletconnect cloud PROJECT_ID>
WALLET_CONNECT_PROJECT_ID=<project_id>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ soljson.js
*_group*.ts
stats.json
release
.env


# compiled output
Expand Down
2 changes: 1 addition & 1 deletion apps/walletconnect/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = composePlugins(withNx(), (config) => {
process: 'process/browser'
})
)

console.log(process.env.WALLET_CONNECT_PROJECT_ID)
// set the define plugin to load the WALLET_CONNECT_PROJECT_ID
config.plugins.push(
new webpack.DefinePlugin({
Expand Down
10 changes: 10 additions & 0 deletions libs/remix-ui/run-tab/src/lib/run-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ export function RunTabUI(props: RunTabProps) {
}
}, [runTab.popup])

useEffect(() => {
if (runTab.selectExEnv.includes('injected') &&
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about wallets?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand what you mean by wallets.

Object.entries(runTab.accounts.loadedAccounts).length === 0 &&
runTab.accounts.selectedAccount.length > 0) {
// switch to vm-cancum because no account is loaded from injected provider
const context = plugin.blockchain.defaultPinnedProviders[0] // vm-cancun
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we load load the previously selected or it will be difficult to do?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would just require some more code to track any account that is selected and persist it outside the reach of a useEffect.

setExecutionEnvironment({ context, fork: '' })
}
}, [runTab.accounts.loadedAccounts])

const setCheckIpfs = (value: boolean) => {
dispatch(setIpfsCheckedState(value))
}
Expand Down
1 change: 1 addition & 0 deletions libs/remix-ui/run-tab/src/lib/types/blockchain.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class Blockchain extends Plugin<any, any> {
};
setupProviders(): void;
providers: any;
defaultPinnedProviders: string[];
getCurrentProvider(): any;
/** Return the list of accounts */
getAccounts(cb?: any): any;
Expand Down
Loading