mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 18:13:31 +00:00
call remote shutdown on app quit
This commit is contained in:
parent
7562c619d2
commit
8f692b6f4d
2 changed files with 3 additions and 1 deletions
|
|
@ -75,7 +75,7 @@ function send({ client, data, event }: SendData): void {
|
|||
}
|
||||
}
|
||||
|
||||
const shutdownServer = () => {
|
||||
export const shutdownServer = () => {
|
||||
if (wsServer) {
|
||||
wsServer.clients.forEach((client) => client.close(4000));
|
||||
wsServer.close();
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import path, { join } from 'path';
|
|||
import { deflate, inflate } from 'zlib';
|
||||
|
||||
import { disableMediaKeys, enableMediaKeys } from './features/core/player/media-keys';
|
||||
import { shutdownServer } from './features/core/remote';
|
||||
import { store } from './features/core/settings';
|
||||
import MenuBuilder from './menu';
|
||||
import {
|
||||
|
|
@ -310,6 +311,7 @@ async function createWindow(first = true): Promise<void> {
|
|||
});
|
||||
|
||||
ipcMain.on('window-quit', () => {
|
||||
shutdownServer();
|
||||
mainWindow?.close();
|
||||
app.exit();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue