Clarified preload.js description in Step 4

This commit is contained in:
AlexanderBuzz
2023-07-13 09:26:52 +02:00
parent afdbc75089
commit 69e49df3a9

View File

@@ -694,18 +694,23 @@ client.on("transaction", async (transaction) => {
4. In `view/preload.js`, add the following code at the bottom of `exposeInMainWorld()`: 4. In `view/preload.js`, add the following code at the bottom of `exposeInMainWorld()`:
```javascript ```javascript
onEnterAccountAddress: (address) => { contextBridge.exposeInMainWorld('electronAPI', {
onUpdateLedgerData: (callback) => {
ipcRenderer.on('update-ledger-data', callback)
},
onEnterAccountAddress: (address) => {
ipcRenderer.send('address-entered', address) ipcRenderer.send('address-entered', address)
}, },
onUpdateAccountData: (callback) => { onUpdateAccountData: (callback) => {
ipcRenderer.on('update-account-data', callback) ipcRenderer.on('update-account-data', callback)
}, },
// Step 4 code additions - start // Step 4 code additions - start
onUpdateTransactionData: (callback) => { onUpdateTransactionData: (callback) => {
ipcRenderer.on('update-transaction-data', callback) ipcRenderer.on('update-transaction-data', callback)
} }
// Step 4 code additions - end // Step 4 code additions - end
})
``` ```
5. Modify `view/template.html` by adding a new fieldset below the ones that are already there: 5. Modify `view/template.html` by adding a new fieldset below the ones that are already there: