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
a1178f7a
Unverified
Commit
a1178f7a
authored
Jun 09, 2021
by
Sarah Otts
Committed by
GitHub
Jun 09, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5567 from seotts/muted-update-session
When a user gets muted, update mute status in the session
parents
7cbff4bd
3d6a7898
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
src/redux/session.js
src/redux/session.js
+12
-0
src/views/preview/comment/compose-comment.jsx
src/views/preview/comment/compose-comment.jsx
+3
-1
No files found.
src/redux/session.js
View file @
a1178f7a
...
...
@@ -121,6 +121,18 @@ module.exports.refreshSessionWithRetry = () => (dispatch => {
});
});
module
.
exports
.
updateMuteStatus
=
muteStatus
=>
((
dispatch
,
getState
)
=>
{
const
session
=
getState
().
session
.
session
;
const
newSession
=
{
...
session
,
permissions
:
{
...
session
.
permissions
,
mute_status
:
muteStatus
}
};
dispatch
(
module
.
exports
.
setSession
(
newSession
));
});
// Selectors
module
.
exports
.
selectIsLoggedIn
=
state
=>
!!
get
(
state
,
[
'
session
'
,
'
session
'
,
'
user
'
],
false
);
module
.
exports
.
selectUsername
=
state
=>
get
(
state
,
[
'
session
'
,
'
session
'
,
'
user
'
,
'
username
'
],
null
);
...
...
src/views/preview/comment/compose-comment.jsx
View file @
a1178f7a
...
...
@@ -17,7 +17,7 @@ const formatTime = require('../../../lib/format-time');
const
connect
=
require
(
'
react-redux
'
).
connect
;
const
api
=
require
(
'
../../../lib/api
'
);
const
{
selectMuteStatus
}
=
require
(
'
../../../redux/session.js
'
);
const
{
selectMuteStatus
,
updateMuteStatus
}
=
require
(
'
../../../redux/session.js
'
);
require
(
'
./comment.scss
'
);
...
...
@@ -118,6 +118,7 @@ class ComposeComment extends React.Component {
showWarning
=
body
.
status
.
mute_status
.
showWarning
;
muteType
=
body
.
status
.
mute_status
.
currentMessageType
;
this
.
setupMuteExpirationTimeout
(
muteExpiresAtMs
);
this
.
props
.
dispatch
(
updateMuteStatus
(
body
.
status
.
mute_status
));
}
// Note: does not reset the message state
this
.
setState
({
...
...
@@ -425,6 +426,7 @@ class ComposeComment extends React.Component {
ComposeComment
.
propTypes
=
{
commenteeId
:
PropTypes
.
number
,
dispatch
:
PropTypes
.
func
,
isReply
:
PropTypes
.
bool
,
muteStatus
:
PropTypes
.
shape
({
offenses
:
PropTypes
.
array
,
...
...
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