Skip to content

Commit

Permalink
fix(ui): fixed type error
Browse files Browse the repository at this point in the history
  • Loading branch information
asalem1 committed Dec 11, 2019
1 parent f91fd13 commit 04fa483
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ui/src/shared/components/cells/Cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ class CellComponent extends Component<Props, State> {

const mstp = (state: AppState, ownProps: OwnProps): StateProps => {
const view = getView(state, ownProps.cell.id)
const timeRange = getActiveTimeRange(
ownProps.timeRange,
view.properties.queries
)
let timeRange = null
if (view.properties.type !== 'markdown') {
timeRange = getActiveTimeRange(ownProps.timeRange, view.properties.queries)
}
const status = getViewStatus(state, ownProps.cell.id)

const check = getCheckForView(state, view)
Expand Down
6 changes: 5 additions & 1 deletion ui/src/timeMachine/selectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {

// Types
import {
DashboardQuery,
FluxTable,
QueryView,
AppState,
Expand Down Expand Up @@ -291,7 +292,10 @@ export const getEndTime = (timeRange: TimeRange): number => {
return moment().valueOf()
}

export const getActiveTimeRange = (timeRange: TimeRange, queries: array) => {
export const getActiveTimeRange = (
timeRange: TimeRange,
queries: Array<DashboardQuery>
) => {
if (!queries) {
return timeRange
}
Expand Down

0 comments on commit 04fa483

Please sign in to comment.