Open Boco10 opened 8 years ago
Something like flash messages in Yii ? On Nov 13, 2015 12:35 PM, "Boco10" notifications@github.com wrote:
I would like to show some useful info if the user is looking at the page. Something has stopped, started etc. Is there any way to implement a way to create notification which will be a notify for one and only?
— Reply to this email directly or view it on GitHub https://github.com/machour/yii2-notifications/issues/9.
Yeah, but still like that way you are doing. Store it in db. And get the data from DB because i would like to use a cronjob for sending out notifications.
I'm willing to implement this, but I think it should be discussed further more..
When should this notification be marked as read ? Imagine you both use the Widget and a cron sending unseen notifications. Would the cron being executed before the page prevent the Widget from seing the notification ?
It's a good question. The main idea is, i have a cron which collects infos, etc. This will run like every minutes. I only want to show those notifications if the user is logged in. So if the user is offline, this will be a default seen notification. If the user is logged in, and there is a new notification which has to be seen once only. Will need to mark is as read right after it popped up. No matter the user clicked on it or not. I would use it an 'on the fly' notification. Like an extra.
Some messages it would be good to mark as seen if the user clicks on the drop down icon to display all notifications
@Boco10 I think I'm failing to see exactly what you mean.. would you be willing to propose a PR ? ( @michaelst feel free to open a new issue/PR for your idea, and make sure to make it work for all templates ;-) )
@Boco10 a possible solution would be to add a 'flash' expiration time on the notification. If the message is not marked as flashed within 5 minutes (i.e. user is offline), the message will not be shown. This can be implemented by in the controller actionPull query by ignoring messages which are not flashed and are older than expiration time.
I would like to show some useful info if the user is looking at the page. Something has stopped, started etc. Is there any way to implement a way to create notification which will be a notify for one and only?