summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2022-05-05 15:03:09 -0700
committerClark Boylan <clark.boylan@gmail.com>2022-05-05 15:03:09 -0700
commit1e4cbf3bb120cc4fb0cb4ed286dc39bbea8b29fa (patch)
tree67a27c40751dc9148802dea2b1f489909cb6a8fa /web
parentf623adefab38d3603b08643b2eca5d03a2d9e802 (diff)
downloadzuul-1e4cbf3bb120cc4fb0cb4ed286dc39bbea8b29fa.tar.gz
Set logfile isFetching initial state to true
Setting the logfile isFetching initial state to true is more accurate to reality as when the logfile object is first insantiated it has not been fetched and is going to be fetched. This is important to ensure our useEffect() callbacks file and apply at the right times otherwise they will update values too early, fire, then not fire again when the fetching is complete. If they fire before fetching is complete then they do not function. Change-Id: Ic8cd2e4ab2d2d7fd5f74ff6862f719c0aaa756dc
Diffstat (limited to 'web')
-rw-r--r--web/src/containers/logfile/LogFile.jsx5
-rw-r--r--web/src/reducers/initialState.js2
2 files changed, 6 insertions, 1 deletions
diff --git a/web/src/containers/logfile/LogFile.jsx b/web/src/containers/logfile/LogFile.jsx
index f8b198450..7184646bd 100644
--- a/web/src/containers/logfile/LogFile.jsx
+++ b/web/src/containers/logfile/LogFile.jsx
@@ -59,6 +59,11 @@ export default function LogFile({
// Only highlight the lines if the log is present (otherwise it doesn't make
// sense). Although, scrolling to the selected section only works once the
// necessary log lines are part of the DOM tree.
+ // Additionally note that if we set highlightStart before the page content
+ // is available then the window scrolling won't match any lines and we won't
+ // scroll. Then when we try to set highlightStart after page content is loaded
+ // the value isn't different than what is set previously preventing the
+ // scroll event from firing.
if (!isFetching) {
// Get the line numbers to highlight from the URL and directly cast them to
// a number. The substring(1) removes the '#' character.
diff --git a/web/src/reducers/initialState.js b/web/src/reducers/initialState.js
index ce74956e9..d2e306032 100644
--- a/web/src/reducers/initialState.js
+++ b/web/src/reducers/initialState.js
@@ -23,7 +23,7 @@ export default {
logfile: {
// Store files by buildId->filename->content
files: {},
- isFetching: false,
+ isFetching: true,
url: null,
},
auth: {},