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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
2cf1e21a
Commit
2cf1e21a
authored
Aug 16, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Web IDE live preview crashing when loading from merge request
parent
a2d647b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+0
-1
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+5
-2
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
2cf1e21a
...
...
@@ -133,7 +133,6 @@ export default {
.
then
(()
=>
this
.
getRawFileData
({
path
:
this
.
file
.
path
,
baseSha
:
this
.
currentMergeRequest
?
this
.
currentMergeRequest
.
baseCommitSha
:
''
,
}),
)
.
then
(()
=>
{
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
2cf1e21a
...
...
@@ -92,7 +92,7 @@ export const setFileMrChange = ({ commit }, { file, mrChange }) => {
commit
(
types
.
SET_FILE_MERGE_REQUEST_CHANGE
,
{
file
,
mrChange
});
};
export
const
getRawFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
baseSha
})
=>
{
export
const
getRawFileData
=
({
state
,
commit
,
dispatch
,
getters
},
{
path
})
=>
{
const
file
=
state
.
entries
[
path
];
return
new
Promise
((
resolve
,
reject
)
=>
{
service
...
...
@@ -100,6 +100,9 @@ export const getRawFileData = ({ state, commit, dispatch }, { path, baseSha }) =
.
then
(
raw
=>
{
if
(
!
(
file
.
tempFile
&&
!
file
.
prevPath
))
commit
(
types
.
SET_FILE_RAW_DATA
,
{
file
,
raw
});
if
(
file
.
mrChange
&&
file
.
mrChange
.
new_file
===
false
)
{
const
baseSha
=
(
getters
.
currentMergeRequest
&&
getters
.
currentMergeRequest
.
baseCommitSha
)
||
''
;
service
.
getBaseRawFileData
(
file
,
baseSha
)
.
then
(
baseRaw
=>
{
...
...
@@ -122,7 +125,7 @@ export const getRawFileData = ({ state, commit, dispatch }, { path, baseSha }) =
action
:
payload
=>
dispatch
(
'
getRawFileData
'
,
payload
).
then
(()
=>
dispatch
(
'
setErrorMessage
'
,
null
)),
actionText
:
__
(
'
Please try again
'
),
actionPayload
:
{
path
,
baseSha
},
actionPayload
:
{
path
},
});
reject
();
});
...
...
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