From 18253886fb8c516c3a78a69f2255e16174742f18 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 31 Aug 2018 10:57:52 +0100 Subject: [PATCH] Fix order of command --- embark-ui/src/actions/index.js | 2 +- embark-ui/src/components/Console.css | 2 ++ embark-ui/src/components/Console.js | 1 + embark-ui/src/reducers/index.js | 3 +++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js index 94f87b50b..44bf658de 100644 --- a/embark-ui/src/actions/index.js +++ b/embark-ui/src/actions/index.js @@ -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}) }; diff --git a/embark-ui/src/components/Console.css b/embark-ui/src/components/Console.css index 67612e94e..c2656b73c 100644 --- a/embark-ui/src/components/Console.css +++ b/embark-ui/src/components/Console.css @@ -1,4 +1,6 @@ .console--results { height: 200px; overflow-y: scroll; + background-color: #000000; + color: #ffffff; } diff --git a/embark-ui/src/components/Console.js b/embark-ui/src/components/Console.js index 123905a30..8093c45a3 100644 --- a/embark-ui/src/components/Console.js +++ b/embark-ui/src/components/Console.js @@ -25,6 +25,7 @@ class Console extends Component { } handleChange(event) { + event.preventDefault(); this.setState({value: event.target.value}); } diff --git a/embark-ui/src/reducers/index.js b/embark-ui/src/reducers/index.js index e0774e804..1d5ada53a 100644 --- a/embark-ui/src/reducers/index.js +++ b/embark-ui/src/reducers/index.js @@ -41,6 +41,9 @@ const sorter = { }, messages: function(a, b) { return a.time - b.time; + }, + commands: function(a, b) { + return b.timestamp - a.timestamp; } };