-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make snack bar messages persistent by default #1284
Conversation
20c31bc
to
2ca94ce
Compare
type: ActionType.MESSAGE_ADD, | ||
payload: messageData, | ||
meta: { | ||
id, | ||
type, | ||
persistent, | ||
persistent: R.propOr(true, 'persistent', messageData), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it default to true
only if type
is MESSAGE_TYPE.ERROR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it and even did it at first. But when I began to place persistent flags in message objects, I realized that there is confusion. So I decided to do it persistent by default for all types of messages.
c486678
to
650723c
Compare
@nkrkv @evgenykochetkov just fixed it. Check it out, please. |
persistent = false, | ||
id = null | ||
) => ({ | ||
const getDefaultPersistencyByType = type => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just const getDefaultPersistencyByType = R.equals(MESSAGE_TYPE.ERROR)
?
case MESSAGE_TYPE.CONFIRMATION: | ||
case MESSAGE_TYPE.NOTIFICATION: | ||
default: | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole function can be simplified to type === MESSAGE_TYPE.ERROR
.
650723c
to
bf2d9ff
Compare
My bad 🙈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
It closes #1234