docs: use optional chaining for app.dock (#46139)

docs: use optional chaining for app.dock

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Niklas Wenzel <dev@nikwen.de>
This commit is contained in:
trop[bot] 2025-03-19 18:50:05 -05:00 committed by GitHub
parent c2ba6b7a28
commit 344b0ae3ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 7 deletions

View file

@ -50,9 +50,7 @@ const dockMenu = Menu.buildFromTemplate([
])
app.whenReady().then(() => {
if (process.platform === 'darwin') {
app.dock.setMenu(dockMenu)
}
app.dock?.setMenu(dockMenu)
}).then(createWindow)
app.on('window-all-closed', () => {