Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Mobile
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
188
Issues
188
List
Boards
Labels
Service Desk
Milestones
Merge Requests
13
Merge Requests
13
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Commits
ba34258c
Commit
ba34258c
authored
13 minutes ago
by
Martin Santangelo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix) channel screen should react to permissions load
parent
28c29bf8
feat/permissions-implementation-model-activitysheet-channels
1 merge request
!387
WIP: Permissions EPIC
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/channel/ChannelScreen.js
src/channel/ChannelScreen.js
+13
-0
No files found.
src/channel/ChannelScreen.js
View file @
ba34258c
...
...
@@ -134,6 +134,11 @@ class ChannelScreen extends Component {
* @param {UserModel} channel
*/
checkCanView
(
channel
)
{
// if the channel obj doesn't have the permissions loaded return true
if
(
!
channel
.
permissions
.
permissions
)
{
return
true
}
if
(
!
channel
.
can
(
FLAG_VIEW
,
true
))
{
this
.
props
.
navigation
.
goBack
();
return
false
;
...
...
@@ -184,6 +189,7 @@ class ChannelScreen extends Component {
* Render
*/
render
()
{
const
store
=
this
.
props
.
channel
.
store
(
this
.
guid
);
if
(
!
this
.
guid
||
!
store
.
channel
.
guid
)
{
...
...
@@ -192,6 +198,13 @@ class ChannelScreen extends Component {
);
}
/**
* We check in the render method in order to observe the changes of the channels permissions
* this is needed because in some cases the channel is shown using the owner of an activity
* while we refresh the channel's data from the server
*/
this
.
checkCanView
(
store
.
channel
);
const
feed
=
store
.
feedStore
;
const
channel
=
store
.
channel
;
const
rewards
=
store
.
rewards
;
...
...
This diff is collapsed.
Click to expand it.
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