Skip to content

Commit dc942c0

Browse files
committed
Small fix with handlers
1 parent e4a6009 commit dc942c0

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

app/electron-bridge.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ipcRenderer, shell, contextBridge } from 'electron'
1+
import { contextBridge, ipcRenderer, shell } from 'electron'
22

33
contextBridge.exposeInMainWorld('ElectronBridge', {
44
// helloWorld: () {

app/main.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ function closeWindows (windowArray) {
383383
for (const window of windowArray) {
384384
window.hide()
385385
if (windowArray[0] === window) {
386-
ipcMain.removeAllListeners('send-break-data')
387-
ipcMain.removeAllListeners('send-microbreak-data')
386+
ipcMain.removeHandler('send-break-data')
387+
ipcMain.removeHandler('send-microbreak-data')
388388
}
389389
window.close()
390390
}
@@ -635,6 +635,7 @@ function createSyncPreferencesWindow () {
635635
sandbox: false
636636
}
637637
})
638+
syncPreferencesWindow.webContents.openDevTools()
638639
syncPreferencesWindow.loadURL(syncPreferencesUrl)
639640
if (syncPreferencesWindow) {
640641
syncPreferencesWindow.on('closed', () => {
@@ -1004,11 +1005,6 @@ function breakComplete (shouldPlaySound, windows, breakType) {
10041005
const audio = breakType === 'mini' ? 'miniBreakAudio' : 'audio'
10051006
processWin.webContents.send('play-sound', settings.get(audio), settings.get('volume'))
10061007
}
1007-
if (breakType === 'long') {
1008-
ipcMain.removeHandler('send-break-data')
1009-
} else {
1010-
ipcMain.removeHandler('send-microbreak-data')
1011-
}
10121008
if (process.platform === 'darwin') {
10131009
// get focus on the last app
10141010
Menu.sendActionToFirstResponder('hide:')
@@ -1567,6 +1563,7 @@ ipcMain.on('open-contributor-auth', function (event, provider) {
15671563
sandbox: false
15681564
}
15691565
})
1566+
myStretchlyWindow.webContents.openDevTools()
15701567
myStretchlyWindow.loadURL(myStretchlyUrl)
15711568
if (myStretchlyWindow) {
15721569
myStretchlyWindow.on('closed', () => {

0 commit comments

Comments
 (0)