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,6 +694,10 @@ 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
contextBridge.exposeInMainWorld('electronAPI', {
onUpdateLedgerData: (callback) => {
ipcRenderer.on('update-ledger-data', callback)
},
onEnterAccountAddress: (address) => { onEnterAccountAddress: (address) => {
ipcRenderer.send('address-entered', address) ipcRenderer.send('address-entered', address)
}, },
@@ -706,6 +710,7 @@ 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: