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
71b93cb2
Commit
71b93cb2
authored
Sep 01, 2017
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce unread count on successful admin message dismiss
parent
630ae5e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
src/redux/messages.js
src/redux/messages.js
+4
-1
src/views/messages/container.jsx
src/views/messages/container.jsx
+3
-1
No files found.
src/redux/messages.js
View file @
71b93cb2
...
@@ -3,6 +3,7 @@ var keyMirror = require('keymirror');
...
@@ -3,6 +3,7 @@ var keyMirror = require('keymirror');
var
api
=
require
(
'
../lib/api
'
);
var
api
=
require
(
'
../lib/api
'
);
var
log
=
require
(
'
../lib/log
'
);
var
log
=
require
(
'
../lib/log
'
);
var
messageCountActions
=
require
(
'
./message-count.js
'
);
module
.
exports
.
Status
=
keyMirror
({
module
.
exports
.
Status
=
keyMirror
({
FETCHED
:
null
,
FETCHED
:
null
,
...
@@ -135,7 +136,7 @@ module.exports.clearMessageCount = function () {
...
@@ -135,7 +136,7 @@ module.exports.clearMessageCount = function () {
};
};
};
};
module
.
exports
.
clearAdminMessage
=
function
(
messageType
,
messageId
,
adminMessages
)
{
module
.
exports
.
clearAdminMessage
=
function
(
messageType
,
messageId
,
messageCount
,
adminMessages
)
{
return
function
(
dispatch
)
{
return
function
(
dispatch
)
{
dispatch
(
module
.
exports
.
setStatus
(
'
CLEAR_STATUS
'
,
module
.
exports
.
Status
.
FETCHING
));
dispatch
(
module
.
exports
.
setStatus
(
'
CLEAR_STATUS
'
,
module
.
exports
.
Status
.
FETCHING
));
api
({
api
({
...
@@ -156,6 +157,7 @@ module.exports.clearAdminMessage = function (messageType, messageId, adminMessag
...
@@ -156,6 +157,7 @@ module.exports.clearAdminMessage = function (messageType, messageId, adminMessag
if
(
!
body
.
success
)
{
if
(
!
body
.
success
)
{
dispatch
(
module
.
exports
.
setStatus
(
'
DELETE_STATUS
'
,
module
.
exports
.
Status
.
DELETE_ERROR
));
dispatch
(
module
.
exports
.
setStatus
(
'
DELETE_STATUS
'
,
module
.
exports
.
Status
.
DELETE_ERROR
));
dispatch
(
module
.
exports
.
setMessagesError
(
'
messages not cleared
'
));
dispatch
(
module
.
exports
.
setMessagesError
(
'
messages not cleared
'
));
return
;
}
}
if
(
messageType
===
'
invite
'
)
{
if
(
messageType
===
'
invite
'
)
{
...
@@ -173,6 +175,7 @@ module.exports.clearAdminMessage = function (messageType, messageId, adminMessag
...
@@ -173,6 +175,7 @@ module.exports.clearAdminMessage = function (messageType, messageId, adminMessag
adminMessages
.
splice
(
toRemove
,
1
);
adminMessages
.
splice
(
toRemove
,
1
);
dispatch
(
module
.
exports
.
setAdminMessages
(
adminMessages
));
dispatch
(
module
.
exports
.
setAdminMessages
(
adminMessages
));
}
}
dispatch
(
messageCountActions
.
setCount
(
messageCount
-
1
));
dispatch
(
module
.
exports
.
setStatus
(
'
DELETE_STATUS
'
,
module
.
exports
.
Status
.
FETCHED
));
dispatch
(
module
.
exports
.
setStatus
(
'
DELETE_STATUS
'
,
module
.
exports
.
Status
.
FETCHED
));
});
});
};
};
...
...
src/views/messages/container.jsx
View file @
71b93cb2
...
@@ -95,7 +95,9 @@ var Messages = React.createClass({
...
@@ -95,7 +95,9 @@ var Messages = React.createClass({
adminMessages
=
this
.
props
.
adminMessages
;
adminMessages
=
this
.
props
.
adminMessages
;
}
}
this
.
props
.
dispatch
(
this
.
props
.
dispatch
(
messageActions
.
clearAdminMessage
(
messageType
,
messageId
,
adminMessages
)
messageActions
.
clearAdminMessage
(
messageType
,
messageId
,
this
.
props
.
numNewMessages
,
adminMessages
)
);
);
},
},
handleLoadMoreMessages
:
function
()
{
handleLoadMoreMessages
:
function
()
{
...
...
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