Fix order of command

This commit is contained in:
Anthony Laibe 2018-08-31 10:57:52 +01:00 committed by Pascal Precht
parent 2d847b9e7c
commit 18253886fb
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D
4 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,7 @@ export const processes = {
export const COMMANDS = createRequestTypes('COMMANDS');
export const commands = {
post: (command) => action(COMMANDS[REQUEST], {command}),
success: (command) => action(COMMANDS[SUCCESS], {commands: [command]}),
success: (command) => action(COMMANDS[SUCCESS], {commands: [{timestamp: new Date().getTime(), ...command}]}),
failure: (error) => action(COMMANDS[FAILURE], {error})
};

View File

@ -1,4 +1,6 @@
.console--results {
height: 200px;
overflow-y: scroll;
background-color: #000000;
color: #ffffff;
}

View File

@ -25,6 +25,7 @@ class Console extends Component {
}
handleChange(event) {
event.preventDefault();
this.setState({value: event.target.value});
}

View File

@ -41,6 +41,9 @@ const sorter = {
},
messages: function(a, b) {
return a.time - b.time;
},
commands: function(a, b) {
return b.timestamp - a.timestamp;
}
};