Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3baefdd2
Commit
3baefdd2
authored
Jul 26, 2021
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes collapsed state loading not working with virtual scroller
Closes
https://gitlab.com/gitlab-org/gitlab/-/issues/336222
parent
ad1dbf5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+21
-6
No files found.
app/assets/javascripts/diffs/components/diff_file.vue
View file @
3baefdd2
...
...
@@ -83,6 +83,7 @@ export default {
idState
()
{
return
{
isLoadingCollapsedDiff
:
false
,
hasLoadedCollapsedDiff
:
false
,
forkMessageVisible
:
false
,
hasToggled
:
false
,
};
...
...
@@ -181,7 +182,13 @@ export default {
},
'
file.file_hash
'
:
{
handler
:
function
hashChangeWatch
(
newHash
,
oldHash
)
{
if
(
newHash
&&
oldHash
&&
!
this
.
hasDiff
&&
!
this
.
preRender
)
{
if
(
newHash
&&
oldHash
&&
!
this
.
hasDiff
&&
!
this
.
preRender
&&
!
this
.
idState
.
hasLoadedCollapsedDiff
)
{
this
.
requestDiff
();
}
},
...
...
@@ -265,14 +272,22 @@ export default {
}
},
requestDiff
()
{
this
.
idState
.
isLoadingCollapsedDiff
=
true
;
const
{
idState
,
file
}
=
this
;
this
.
loadCollapsedDiff
(
this
.
file
)
idState
.
isLoadingCollapsedDiff
=
true
;
this
.
loadCollapsedDiff
(
file
)
.
then
(()
=>
{
this
.
idState
.
isLoadingCollapsedDiff
=
false
;
this
.
setRenderIt
(
this
.
file
);
idState
.
isLoadingCollapsedDiff
=
false
;
idState
.
hasLoadedCollapsedDiff
=
true
;
if
(
this
.
file
.
file_hash
===
file
.
file_hash
)
{
this
.
setRenderIt
(
this
.
file
);
}
})
.
then
(()
=>
{
if
(
this
.
file
.
file_hash
!==
file
.
file_hash
)
return
;
requestIdleCallback
(
()
=>
{
this
.
postRender
();
...
...
@@ -282,7 +297,7 @@ export default {
);
})
.
catch
(()
=>
{
this
.
idState
.
isLoadingCollapsedDiff
=
false
;
idState
.
isLoadingCollapsedDiff
=
false
;
createFlash
({
message
:
this
.
$options
.
i18n
.
genericError
,
});
...
...
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