Skip to content

Commit

Permalink
Some naming polishing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarl committed Jun 20, 2017
1 parent deaec24 commit 90350f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions client/app/scripts/actions/app-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ export function receiveNodesForTopology(nodes, topologyId) {
}

export function receiveTopologies(topologies) {
return (dispatch, getWeirdState) => {
const getState = () => getWeirdState().scope || getWeirdState();
return (dispatch, getGlobalState) => {
// NOTE: Fortunately, this will go when Time Travel is out of <CloudFeature />.
const getState = () => getGlobalState().scope || getGlobalState();
const firstLoad = !getState().get('topologiesLoaded');
dispatch({
type: ActionTypes.RECEIVE_TOPOLOGIES,
Expand Down
7 changes: 4 additions & 3 deletions client/app/scripts/utils/string-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ export function ipToPaddedString(value) {
// Formats metadata values. Add a key to the `formatters` obj
// that matches the `dataType` of the field. You must return an Object
// with the keys `value` and `title` defined.
export function formatDataType(field, currentTimestamp) {
// `referenceTimestamp` is the timestamp we've time-travelled to.
export function formatDataType(field, referenceTimestampStr = null) {
const formatters = {
datetime(timestampString) {
const timestamp = moment(timestampString);
const now = currentTimestamp ? moment(currentTimestamp) : moment();
const referenceTimestamp = referenceTimestampStr ? moment(referenceTimestampStr) : moment();
return {
value: timestamp.from(now),
value: timestamp.from(referenceTimestamp),
title: timestamp.utc().toISOString()
};
}
Expand Down

0 comments on commit 90350f1

Please sign in to comment.