Skip to content

Commit

Permalink
Merge pull request #1355 from garden-io/fix-dashboard-logs-page
Browse files Browse the repository at this point in the history
fix(dashboard): fix hooks render order on logs page
  • Loading branch information
eysi09 authored Nov 20, 2019
2 parents 483302b + fb80d34 commit d94b0a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"build": "react-scripts build && ./bin/copy-to-static",
"dev": "EXTEND_ESLINT=true npm run start",
"fix-format": "prettier --write \"{src,test}/**/*.{ts,tsx}\"",
"lint": "tslint -p .",
"lint": "eslint \"{src,test}/**/*.{ts,tsx}\"",
"test-watch": "react-scripts test",
"test": "CI=true react-scripts test",
"eject": "react-scripts eject"
Expand Down
14 changes: 7 additions & 7 deletions dashboard/src/containers/logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export default () => {
}
}, [dispatch, requestStates.logs, serviceNames])

const handleRefresh = useCallback(
(names: string[]) => {
loadLogs(dispatch, names)
},
[dispatch]
)

if (!(requestStates.config.initLoadComplete && requestStates.logs.initLoadComplete)) {
return <Spinner />
}
Expand All @@ -44,12 +51,5 @@ export default () => {
return <PageError error={requestStates.config.error || requestStates.logs.error} />
}

const handleRefresh = useCallback(
(names: string[]) => {
loadLogs(dispatch, names)
},
[dispatch]
)

return <Logs onRefresh={handleRefresh} logs={logs} />
}

0 comments on commit d94b0a8

Please sign in to comment.