Skip to content

Commit

Permalink
fix: fiddle ipc code pattern 3 (#33262)
Browse files Browse the repository at this point in the history
  • Loading branch information
akgupta0777 committed Mar 16, 2022
1 parent 02fe245 commit b274011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/fiddles/ipc/pattern-3/renderer.js
Expand Up @@ -4,5 +4,5 @@ window.electronAPI.handleCounter((event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
event.reply('counter-value', newValue)
event.sender.send('counter-value', newValue)
})
4 changes: 2 additions & 2 deletions docs/tutorial/ipc.md
Expand Up @@ -379,7 +379,7 @@ module that uses the `webContents.send` API to send an IPC message from the main
target renderer.
```javascript {11-26} title='main.js (Main Process)'
const {app, BrowserWindow, Menu} = require('electron')
const {app, BrowserWindow, Menu, ipcMain} = require('electron')
const path = require('path')

function createWindow () {
Expand Down Expand Up @@ -519,7 +519,7 @@ window.electronAPI.onUpdateCounter((event, value) => {
const oldValue = Number(counter.innerText)
const newValue = oldValue + value
counter.innerText = newValue
event.reply('counter-value', newValue)
event.sender.send('counter-value', newValue)
})
```
Expand Down

0 comments on commit b274011

Please sign in to comment.