Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
96589f40
Commit
96589f40
authored
Mar 18, 2021
by
Paul Kaplan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Comment the useEffect usage
parent
f40f3fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/views/studio/studio-activity.jsx
src/views/studio/studio-activity.jsx
+4
-1
No files found.
src/views/studio/studio-activity.jsx
View file @
96589f40
...
@@ -10,9 +10,12 @@ import Debug from './debug.jsx';
...
@@ -10,9 +10,12 @@ import Debug from './debug.jsx';
const
StudioActivity
=
({
items
,
loading
,
error
,
onInitialLoad
})
=>
{
const
StudioActivity
=
({
items
,
loading
,
error
,
onInitialLoad
})
=>
{
const
{
studioId
}
=
useParams
();
const
{
studioId
}
=
useParams
();
// Fetch the data if none has been loaded yet. This would run only once,
// since studioId doesnt change, but the component is potentially mounted
// multiple times because of tab routing, so need to check for empty items.
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
studioId
&&
items
.
length
===
0
)
onInitialLoad
(
studioId
);
if
(
studioId
&&
items
.
length
===
0
)
onInitialLoad
(
studioId
);
},
[
studioId
]);
},
[
studioId
]);
// items.length intentionally left out
return
(
return
(
<
div
>
<
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment