Fix kill button not showing up when restarting
This commit is contained in:
parent
c0f7c9bbf3
commit
231ff0386c
|
@ -8,7 +8,7 @@ const StopOrKillButton = ({ onPress }: { onPress: (action: PowerAction) => void
|
||||||
const status = ServerContext.useStoreState(state => state.status.value);
|
const status = ServerContext.useStoreState(state => state.status.value);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setClicked(state => [ 'stopping' ].indexOf(status) < 0 ? false : state);
|
setClicked(status === 'stopping');
|
||||||
}, [ status ]);
|
}, [ status ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -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 Sockette from 'sockette';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
export const SOCKET_EVENTS = [
|
|
||||||
'SOCKET_OPEN',
|
|
||||||
'SOCKET_RECONNECT',
|
|
||||||
'SOCKET_CLOSE',
|
|
||||||
'SOCKET_ERROR',
|
|
||||||
];
|
|
||||||
|
|
||||||
export class Websocket extends EventEmitter {
|
export class Websocket extends EventEmitter {
|
||||||
// Timer instance for this socket.
|
// Timer instance for this socket.
|
||||||
private timer: any = null;
|
private timer: any = null;
|
||||||
|
|
Loading…
Reference in New Issue