swarmcity / sc-boardwalk

NO LONGER ACTIVE, current development of dApp in SwarmCitySite
25 stars 13 forks source link

create a notification when a new chat msg comes in #382

Closed rodney757 closed 7 years ago

rodney757 commented 7 years ago

partial implementation for #337

While this still creates a notification if the user is in the chat view, it marks the notification as read. Since whisper messages are constantly propagated for 24 hrs, If I don't add a notification while in the chat view, it will be added when the page is reloaded. I thought the best thing to do would be to add a notification with "read: true".

I'm open for suggestions on ways to improve this.

One thought would be to add a "display" property to notifications. If false, the notification isn't displayed in the notifications view. This would allow users to dismiss individual notifications, so when they view the notifications page next time, they don't see any dismissed notifications. Might reduce the notification clutter for active users

rodney757 commented 7 years ago

EDIT: Ignore this, I figured out a solution.

another issue I was running into was redirecting the user directly to the dealchat page when clicking the notification. I was trying to use a query param "?page=dealchat". however I would run into infinite loop issues.

sponnet commented 7 years ago

Currently there are some notifications that could have a route to redirect to at on-tap:

But other don't have a route :

You could implement the redirect in the former cases.

Later on a decentralized push notifications system should be put in place, but I believe that our friends at status.im are working on that.