OSDN Git Service
(root)
/
bytom
/
bytom-electron.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ec88271
)
auto disappear message in 5s https://github.com/Bytom/bytom/issues/840
author
Zhiting Lin
<zlin035@uottawa.ca>
Sat, 28 Apr 2018 03:49:15 +0000
(11:49 +0800)
committer
Zhiting Lin
<zlin035@uottawa.ca>
Sat, 28 Apr 2018 03:49:15 +0000
(11:49 +0800)
src/features/shared/components/Flash/Flash.jsx
patch
|
blob
|
history
diff --git
a/src/features/shared/components/Flash/Flash.jsx
b/src/features/shared/components/Flash/Flash.jsx
index
61d3923
..
28ce269
100644
(file)
--- a/
src/features/shared/components/Flash/Flash.jsx
+++ b/
src/features/shared/components/Flash/Flash.jsx
@@
-62,6
+62,9
@@
class Flash extends React.Component {
const item = props.messages[key]
if (!item.displayed) {
this.props.markFlashDisplayed(key)
+ setTimeout(() => {
+ this.props.dismissFlash(key)
+ }, 5000)
}
})
}
@@
-71,10
+74,14
@@
class Flash extends React.Component {
const item = nextProps.messages[key]
if (!item.displayed) {
this.props.markFlashDisplayed(key)
+ setTimeout(() => {
+ this.props.dismissFlash(key)
+ }, 5000)
}
})
}
+
render() {
if (!this.props.messages || this.props.hideFlash) {
return null