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
3934c92c
Unverified
Commit
3934c92c
authored
Dec 07, 2018
by
Paul Kaplan
Committed by
GitHub
Dec 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2423 from paulkaplan/add-to-studio-fix
Show addToStudio for all logged in users on shared projects
parents
74490f09
4522983e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/views/preview/project-view.jsx
src/views/preview/project-view.jsx
+5
-3
No files found.
src/views/preview/project-view.jsx
View file @
3934c92c
...
...
@@ -764,11 +764,14 @@ const mapStateToProps = state => {
const
userOwnsProject
=
isLoggedIn
&&
authorPresent
&&
state
.
session
.
session
.
user
.
id
.
toString
()
===
authorId
;
// if we don't have projectInfo, assume it's shared until we know otherwise
const
isShared
=
!
projectInfoPresent
||
state
.
preview
.
projectInfo
.
is_published
;
return
{
authorId
:
authorId
,
authorThumbnailUrl
:
thumbnailUrl
(
authorId
),
authorUsername
:
authorUsername
,
canAddToStudio
:
userOwnsProject
,
canAddToStudio
:
isLoggedIn
&&
isShared
,
canCreateCopy
:
userOwnsProject
&&
projectInfoPresent
,
canCreateNew
:
isLoggedIn
,
canRemix
:
isLoggedIn
&&
projectInfoPresent
&&
!
userOwnsProject
,
...
...
@@ -789,8 +792,7 @@ const mapStateToProps = state => {
isAdmin
:
isAdmin
,
isNewScratcher
:
isLoggedIn
&&
state
.
permissions
.
new_scratcher
,
isScratcher
:
isLoggedIn
&&
state
.
permissions
.
scratcher
,
// if we don't have projectInfo, assume it's shared until we know otherwise
isShared
:
!
projectInfoPresent
||
state
.
preview
.
projectInfo
.
is_published
,
isShared
:
isShared
,
loved
:
state
.
preview
.
loved
,
moreCommentsToLoad
:
state
.
preview
.
moreCommentsToLoad
,
original
:
state
.
preview
.
original
,
...
...
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