Streaming Transfers (#4548)
This commit is contained in:
parent
032e4f2e31
commit
df2402b54f
6 changed files with 38 additions and 106 deletions
|
@ -7,19 +7,19 @@ const TransferListener = () => {
|
|||
const getServer = ServerContext.useStoreActions((actions) => actions.server.getServer);
|
||||
const setServerFromState = ServerContext.useStoreActions((actions) => actions.server.setServerFromState);
|
||||
|
||||
// Listen for the transfer status event so we can update the state of the server.
|
||||
// Listen for the transfer status event, so we can update the state of the server.
|
||||
useWebsocketEvent(SocketEvent.TRANSFER_STATUS, (status: string) => {
|
||||
if (status === 'starting') {
|
||||
if (status === 'pending' || status === 'processing') {
|
||||
setServerFromState((s) => ({ ...s, isTransferring: true }));
|
||||
return;
|
||||
}
|
||||
|
||||
if (status === 'failure') {
|
||||
if (status === 'failed') {
|
||||
setServerFromState((s) => ({ ...s, isTransferring: false }));
|
||||
return;
|
||||
}
|
||||
|
||||
if (status !== 'success') {
|
||||
if (status !== 'completed') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,13 +76,6 @@ export default () => {
|
|||
case 'failure':
|
||||
terminal.writeln(TERMINAL_PRELUDE + 'Transfer has failed.\u001b[0m');
|
||||
return;
|
||||
|
||||
// Sent by the source node whenever the server was archived successfully.
|
||||
case 'archive':
|
||||
terminal.writeln(
|
||||
TERMINAL_PRELUDE +
|
||||
'Server has been archived successfully, attempting connection to target node..\u001b[0m'
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue