Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 8585a17

Browse files
authored
Post-merge fixes: delete leftover ipc calls (#40)
1 parent fe65cb3 commit 8585a17

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/server/api/window.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,13 @@ router.post('/open', (req, res) => {
189189
}
190190

191191
window.on('blur', () => {
192-
window.webContents.send('window:blur')
193192
notifyLaravel('events', {
194193
event: 'Native\\Laravel\\Events\\Windows\\WindowBlurred',
195194
payload: [id]
196195
})
197196
});
198197

199198
window.on('focus', () => {
200-
window.webContents.send('window:focus')
201199
notifyLaravel('events', {
202200
event: 'Native\\Laravel\\Events\\Windows\\WindowFocused',
203201
payload: [id]

src/server/utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ export async function appendCookie() {
1212
}
1313

1414
export async function notifyLaravel(endpoint: string, payload = {}) {
15+
16+
if (endpoint === 'events') {
17+
broadcastToWindows('native-event', payload);
18+
}
19+
1520
try {
1621
await axios.post(
1722
`http://127.0.0.1:${state.phpPort}/_native/api/${endpoint}`,
@@ -25,10 +30,6 @@ export async function notifyLaravel(endpoint: string, payload = {}) {
2530
} catch (e) {
2631
//
2732
}
28-
29-
if (endpoint === 'events') {
30-
broadcastToWindows('native-event', payload);
31-
}
3233
}
3334

3435
export function broadcastToWindows(event, payload) {

0 commit comments

Comments
 (0)