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

[Bug]: the example in the document of represented file creates BrowserWindow twice #38406

Closed
HQidea opened this issue May 23, 2023 · 2 comments · Fixed by #40233
Closed

[Bug]: the example in the document of represented file creates BrowserWindow twice #38406

HQidea opened this issue May 23, 2023 · 2 comments · Fixed by #40233

Comments

@HQidea
Copy link

HQidea commented May 23, 2023

doc link: https://www.electronjs.org/docs/latest/tutorial/represented-file
code:

function createWindow () {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
const win = new BrowserWindow()
win.setRepresentedFilename(os.homedir())
win.setDocumentEdited(true)
})

The code in the example creates BrowserWindow both in the createWindow function and after app.whenReady(), which not loads index.html properly.

@electron-issue-triage
Copy link

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@HQidea
Copy link
Author

HQidea commented Sep 8, 2023

May I send a pr to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants