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

docs: fix missing dependencies in ipc patterns #33082

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

chuion
Copy link
Contributor

@chuion chuion commented Feb 25, 2022

Fix missing dependencies in ipc patterns

  • updated docs/fiddles/ipc/pattern-3/main.js otherwise it would have thrown "UnhandledPromiseRejectionWarning: ReferenceError: ipcMain is not defined"
  • updated docs/fiddles/ipc/pattern-2/main.js to adapt coding style

There is a another bug in docs/fiddles/ipc/pattern-3/renderer.js : event.reply is undefined .

const counter = document.getElementById('counter')

window.electronAPI.handleCounter((event, value) => {
    const oldValue = Number(counter.innerText)
    const newValue = oldValue + value
    counter.innerText = newValue
    event.reply('counter-value', newValue)  // `event.reply` is undefined, `event.sender.send` is available.
})

Checklist

  • relevant documentation is changed or added

Release Notes

Notes: none

@welcome
Copy link

welcome bot commented Feb 25, 2022

💖 Thanks for opening this pull request! 💖

We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix.

Examples of commit messages with semantic prefixes:

  • fix: don't overwrite prevent_default if default wasn't prevented
  • feat: add app.isPackaged() method
  • docs: app.isDefaultProtocolClient is now available on Linux

Things that will help get your PR across the finish line:

  • Follow the JavaScript, C++, and Python coding style.
  • Run npm run lint locally to catch formatting errors earlier.
  • Document any user-facing changes you've made following the documentation styleguide.
  • Include tests when adding/changing behavior.
  • Include screenshots and animated GIFs whenever possible.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@electron-cation electron-cation bot added documentation 📓 semver/patch backwards-compatible bug fixes new-pr 🌱 PR opened in the last 24 hours and removed new-pr 🌱 PR opened in the last 24 hours labels Feb 25, 2022
Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @chuion!

@jkleinsc
Copy link
Contributor

jkleinsc commented Mar 7, 2022

Merging as CI failure is unrelated and fixed in #33141.

@jkleinsc jkleinsc merged commit 0ff1727 into electron:main Mar 7, 2022
@welcome
Copy link

welcome bot commented Mar 7, 2022

Congrats on merging your first pull request! 🎉🎉🎉

@release-clerk
Copy link

release-clerk bot commented Mar 7, 2022

No Release Notes

bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants