Skip to content

Commit 0d940f9

Browse files
authored
Merge pull request #6143 from ethereum/csminfo
load smart account instantly & toasters
2 parents 9892c11 + 6c119dc commit 0d940f9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libs/remix-ui/run-tab/src/lib/actions/account.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ export const delegationAuthorization = async (contractAddress: string, plugin: R
189189
}
190190

191191
export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatch<any>) => {
192+
plugin.call('notification', 'toast', `Preparing tx to sign...`)
192193
const { chainId } = plugin.REACT_API
193194
const chain = chains[aaSupportedNetworks[chainId].name]
194195
const PUBLIC_NODE_URL = aaSupportedNetworks[chainId].publicNodeUrl
@@ -254,6 +255,7 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
254255
value: 0
255256
}]
256257
})
258+
plugin.call('notification', 'toast', `Waiting for tx confirmation, can take 5-10 seconds...`)
257259
await saClient.waitForUserOperationReceipt({ hash: useropHash })
258260

259261
// To verify creation, check if there is a contract code at this address
@@ -270,6 +272,7 @@ export const createSmartAccount = async (plugin: RunTab, dispatch: React.Dispatc
270272
const smartAccountsObj = JSON.parse(smartAccountsStr)
271273
smartAccountsObj[chainId] = plugin.REACT_API.smartAccounts
272274
localStorage.setItem(aaLocalStorageKey, JSON.stringify(smartAccountsObj))
275+
await fillAccountsList(plugin, dispatch)
273276
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'createdSuccessfully'])
274277
return plugin.call('notification', 'toast', `Safe account ${safeAccount.address} created for owner ${account}`)
275278
} catch (error) {

libs/remix-ui/run-tab/src/lib/components/account.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ export function AccountUI(props: AccountProps) {
187187
() => {
188188
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'createClicked'])
189189
props.createNewSmartAccount()
190-
_paq.push(['trackEvent', 'udapp', 'safeSmartAccount', 'create'])
191190
},
192191
intl.formatMessage({ id: 'udapp.cancel' }),
193192
() => {

0 commit comments

Comments
 (0)