Fix kill button not showing up when restarting
This commit is contained in:
parent
c0f7c9bbf3
commit
231ff0386c
3 changed files with 11 additions and 8 deletions
|
@ -8,7 +8,7 @@ const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void
|
|||
const status = ServerContext.useStoreState(state => state.status.value);
|
||||
|
||||
useEffect(() => {
|
||||
setClicked(state => [ 'stopping' ].indexOf(status) < 0 ? false : state);
|
||||
setClicked(status === 'stopping');
|
||||
}, [ status ]);
|
||||
|
||||
return (
|
||||
|
|
10
resources/scripts/components/server/events.ts
Normal file
10
resources/scripts/components/server/events.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
export enum SocketEvent {
|
||||
DAEMON_MESSAGE = 'daemon message',
|
||||
INSTALL_OUTPUT = 'install output',
|
||||
INSTALL_STARTED = 'install started',
|
||||
INSTALL_COMPLETED = 'install completed',
|
||||
CONSOLE_OUTPUT = 'console output',
|
||||
STATUS = 'status',
|
||||
STATS = 'stats',
|
||||
BACKUP_COMPLETED = 'backup completed',
|
||||
}
|
|
@ -1,13 +1,6 @@
|
|||
import Sockette from 'sockette';
|
||||
import { EventEmitter } from 'events';
|
||||
|
||||
export const SOCKET_EVENTS = [
|
||||
'SOCKET_OPEN',
|
||||
'SOCKET_RECONNECT',
|
||||
'SOCKET_CLOSE',
|
||||
'SOCKET_ERROR',
|
||||
];
|
||||
|
||||
export class Websocket extends EventEmitter {
|
||||
// Timer instance for this socket.
|
||||
private timer: any = null;
|
||||
|
|
Loading…
Reference in a new issue